<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Srinath Venkatramanan on Medium]]></title>
        <description><![CDATA[Stories by Srinath Venkatramanan on Medium]]></description>
        <link>https://medium.com/@srinathvenkatramanan?source=rss-82d840b78d2c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*t2Qn81-iLSB9q2Rt_5NvRA.jpeg</url>
            <title>Stories by Srinath Venkatramanan on Medium</title>
            <link>https://medium.com/@srinathvenkatramanan?source=rss-82d840b78d2c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 22:36:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srinathvenkatramanan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Chapter 3 — Java Variables]]></title>
            <link>https://srinathvenkatramanan.medium.com/chapter-3-java-variables-78949bf2326d?source=rss-82d840b78d2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/78949bf2326d</guid>
            <category><![CDATA[static-variable]]></category>
            <category><![CDATA[java-variables]]></category>
            <category><![CDATA[instance-variables]]></category>
            <category><![CDATA[local-variable]]></category>
            <dc:creator><![CDATA[Srinath Venkatramanan]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 21:27:36 GMT</pubDate>
            <atom:updated>2025-11-27T21:33:46.551Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 3 — Java Variables</h3><h4>Mastering Java — One concept at a time</h4><p>Variables are one of the simplest yet most essential concepts in Java.<br>Before we dive into methods, loops or OOPS, it’s important to understand <em>how Java stores and manages data</em> during execution.</p><p>In this chapter, we will learn:</p><ul><li>What variables are</li><li>Different types of variables</li><li>How memory allocation works</li><li>Rules for naming variables</li><li>Defaults, constants and best practices</li></ul><p>Let’s get started.</p><p>A <strong>variable</strong> in Java is a <em>named memory location</em> that stores a value while your program runs.</p><p>Think of it as a labelled container:</p><ul><li><strong>Label</strong> → variable name</li><li><strong>The type of container</strong> → data type</li><li><strong>What’s inside</strong> → value</li></ul><pre>int age = 25;</pre><p>Here:</p><ul><li>int → data type</li><li>age → variable name</li><li>25 → value stored in memory</li></ul><h4>Types of Variables in Java</h4><p>Java categorizes variables into <strong>three main types</strong>, based on where they are declared and how long they live.</p><h4>Local Variables</h4><p>Local variables are declared <strong>inside a method, constructor or block</strong>.<br>They exist only until the method finishes execution.</p><p><strong><em>Characteristics</em></strong></p><ul><li>Must be <strong>initialized</strong> before use</li><li>Stored in the <strong>stack memory</strong></li><li>Cannot have access modifiers (public, private, etc.)</li></ul><pre>void show() {<br>    int count = 10; // local variable<br>    System.out.println(count);<br>}</pre><p>If you try to use a local variable without assigning a value, Java gives an error — because they do <strong>not</strong> receive default values.</p><h4>Instance Variables</h4><p>Instance variables (<strong>object variables</strong>) are declared <strong>inside a class but outside methods</strong>.</p><p>Each <strong>object has its own copy</strong> of these variables.</p><p><strong><em>Characteristics</em></strong></p><ul><li>Represent the state of an object</li><li>Stored in the <strong>heap memory</strong></li><li>Get <strong>default values</strong> if not initialized</li></ul><pre>class Car {<br>    String model;  // instance variable<br>    int speed;     // instance variable<br>}</pre><p>Every new Car() object will have different model/speed values.</p><h4>Static Variables (Class Variables)</h4><p>Static variables belong to the <strong>class</strong>, not to objects.</p><p>They are declared with the static keyword.</p><p><strong><em>Characteristics</em></strong></p><ul><li>Shared across <strong>all objects</strong></li><li>Initialized only once (when class loads)</li><li>Useful for constants or shared data</li></ul><pre>class Employee {<br>    static String company = &quot;Google&quot;; // static variable<br>}</pre><p>All Employee objects share the same company name.</p><h4>Default values in Java</h4><p>Java automatically assigns default values to <strong>instance and static</strong> variables.</p><p>Local variables do <strong>not</strong> get defaults.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*p-zdpT9B2_fN_qQN2I5kIQ.png" /></figure><h4>Variable declaration rules (Java naming rules)</h4><p>Java enforces strict naming conventions:</p><p>✔ Must start with a <strong>letter</strong>, _, or $<br> ✔ Cannot start with a number<br> ✔ Case-sensitive<br> ✔ Cannot use Java keywords<br> ✔ Should follow camelCase for readability</p><p><strong><em>Valid:</em></strong></p><pre>int age;<br>double _salary;<br>String $name;</pre><p><strong><em>Invalid:</em></strong></p><pre>int 1value;       // starts with number<br>double class;     // keyword</pre><h4>Final Variables — Making Constants</h4><p>If you want a value that never changes, use final.</p><pre>final double PI = 3.14159;</pre><p>Once assigned, it cannot be modified.<br>Often written in <strong>UPPERCASE</strong>.</p><h4>Memory View: How variables live in Java</h4><p>The below separation helps Java manage memory efficiently and safely.</p><p>1️⃣<strong>Local Variables → Stored in the Stack</strong></p><p><strong><em>What is the Stack?</em></strong></p><ul><li>A small, fast memory area</li><li>Used for <strong>method execution</strong></li><li>Stores: method calls, local variables, temporary values</li></ul><p><strong><em>Why local variables go here?</em></strong></p><ul><li>They exist <em>only while the method runs</em></li><li>They disappear immediately when the method ends</li></ul><pre>void test() {<br>    int x = 10;   // local variable → stack<br>}</pre><p>When test() finishes, x is <strong>deleted instantly</strong>.</p><p>2️⃣<strong>Instance Variables → Stored in the Heap</strong></p><p><strong><em>What is the Heap?</em></strong></p><ul><li>Large memory area</li><li>Stores <strong>objects</strong></li><li>Data stays in memory until:</li><li>no reference is pointing to it</li><li>garbage collector removes it</li></ul><p><strong><em>Why instance variables go here?</em></strong></p><ul><li>Instance variables are <strong>part of objects</strong></li><li>Objects live in the heap</li></ul><pre>class Car {<br>    int speed;       // instance variable<br>    String model;    // instance variable<br>}</pre><pre>Car c1 = new Car();   // object → heap</pre><p>c1 (the object) is stored in the heap.<br>Inside that object, speed and model also live in the heap.</p><p>Each new object gets <strong>its own</strong> heap memory.</p><p>3️⃣<strong>Static Variables → Stored in Method Area (a part of JVM memory)</strong></p><p><strong><em>What is the Method Area?</em></strong></p><ul><li>A special region of JVM memory</li><li>It stores: class-level data, static variables, method bytecode, class metadata</li></ul><p><strong><em>Why static variables go here?</em></strong></p><ul><li>Static variables belong to the <strong>class</strong>, not the object</li><li>They are created <em>when the class loads</em></li><li>They stay until program ends</li></ul><pre>class Employee {<br>    static String company = &quot;Google&quot;;  // static variable<br>}</pre><p>company is stored <strong>once</strong> in the method area, not inside each Employee object.</p><p>Every object shares the same static value.</p><p><strong><em>Why Java Separates These?</em></strong></p><p>This design gives important benefits:</p><p><em>Efficiency</em></p><ol><li>Stack is fast → suitable for short-lived local variables</li><li>Heap is flexible → suitable for objects that live longer</li><li>Method area stores shared data → avoids duplication</li></ol><p><em>Safety</em></p><ol><li>Variables stored separately prevent accidental interference.</li><li>For example, modifying a static variable affects all objects — but modifying an instance variable affects only one object.</li></ol><p><em>Memory Management</em></p><ol><li>Java’s garbage collector cleans the heap automatically.</li><li>Stack memory clears itself after methods end.</li><li>Method area stays stable for class-level data.</li></ol><p>In the next chapter, we’ll dive into <strong>Java Data Types</strong> — the foundation that decides what kind of values your variables can hold.</p><p>If you found this chapter helpful, please do follow the series.</p><p><strong>🖋️ <em>Mastering Java — One Concept at a Time</em></strong><br>Thanks for reading. See you in the next chapter!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78949bf2326d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter 2 — JDK, JVM and JRE]]></title>
            <link>https://srinathvenkatramanan.medium.com/chapter-2-jdk-jvm-and-jre-775e46516db5?source=rss-82d840b78d2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/775e46516db5</guid>
            <category><![CDATA[jre]]></category>
            <category><![CDATA[bytecode]]></category>
            <category><![CDATA[jdk]]></category>
            <category><![CDATA[jvm]]></category>
            <dc:creator><![CDATA[Srinath Venkatramanan]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 22:56:47 GMT</pubDate>
            <atom:updated>2025-11-26T22:56:47.727Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 2 — JDK, JVM and JRE</h3><h4>Mastering Java — One concept at a time</h4><p>Java is a highly popular, platform-independent, object-oriented programming language known for its strong emphasis on portability. One of Java’s biggest advantages is its <strong>“Write Once, Run Anywhere” (WORA)</strong> capability, which allows the same program to run on any system that has a compatible Java Virtual Machine. This portability has played a major role in Java’s widespread adoption across industries and platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*pFKokY8OVC7QAhRbQuuPGQ.png" /></figure><p>There are three main components in Java which powers it.</p><h4>1️⃣JVM</h4><p>The <strong>Java Virtual Machine (JVM)</strong> is the <strong>platform-dependent</strong> component in the Java ecosystem. Every operating system (Windows, Linux, macOS, ARM, etc.) has its own JVM implementation, but all JVMs follow the same specifications defined by Java.</p><p>Even though the JVM itself is platform dependent, it is the <strong>key reason Java achieves platform independence</strong>, because it takes the same bytecode and runs it on any supported system.</p><p>When you compile a Java program, the <strong>javac compiler does not create machine code</strong>. Instead, it produces <strong>bytecode</strong>, an intermediate, platform-independent representation.</p><p>At runtime, the JVM:</p><ol><li><strong>Reads the bytecode</strong></li><li><strong>Interprets it</strong> OR uses the</li><li><strong>JIT (Just-In-Time) compiler</strong> to convert frequently executed sections into <strong>native machine code</strong></li></ol><p>This machine code is specific to the underlying OS and CPU, which makes the JVM <strong>platform dependent</strong>, but keeps the bytecode <strong>platform independent</strong>.</p><p>The platform dependency of JVM helps portability because:</p><ul><li>Java program → <strong>same everywhere</strong></li><li>JVM → <strong>different per OS/CPU</strong></li><li>Machine code → <strong>generated appropriately at runtime</strong></li></ul><p>This separation allows Java to run on any device that has the correct JVM implementation.</p><h4>2️⃣JRE</h4><p>The <strong>Java Runtime Environment (JRE)</strong> is the component of the Java platform that provides everything required to <strong>run</strong> Java applications — but <strong>not</strong> to develop them. It sits between the compiled bytecode and the operating system, supplying the libraries and runtime support the program needs.</p><p>Unlike the JVM — which is strictly an execution engine — the JRE is a <strong>complete runtime bundle</strong> that includes:</p><ul><li>The <strong>JVM</strong></li><li>Core Java <strong>class libraries</strong></li><li>Runtime support files</li><li>Property files, security files and other configuration resources</li></ul><h4>Role of the JRE in the Java Ecosystem</h4><p>When you run a Java program, the JVM needs a set of standard libraries (like java.lang, java.util, java.io, etc.) to understand and execute your code.</p><p>These libraries are provided by the <strong>JRE</strong>.</p><p>Without the JRE:</p><ul><li>The JVM cannot execute your code</li><li>Essential classes and APIs would be missing</li><li>Programs would fail at runtime</li></ul><p>Therefore, while the <strong>JVM executes bytecode</strong>, the <strong>JRE enables that execution by supplying the environment and libraries</strong>.</p><h4>Platform dependency of the JRE</h4><p>The JRE is <strong>platform dependent</strong>, just like the JVM.</p><ul><li>Windows JRE works only on Windows</li><li>Linux JRE works only on Linux</li><li>macOS JRE works only on macOS</li></ul><p>However, the <strong>Java bytecode remains platform independent</strong>.<br>The portability comes from the fact that <strong>every platform has its own JRE</strong>, capable of running the same bytecode.</p><h4>3️⃣JDK</h4><p>The <strong>Java Development Kit (JDK)</strong> is the <strong>complete software development kit</strong> required to <strong>build, compile, debug and run</strong> Java applications. It is the superset of the Java platform components and contains everything a developer needs.</p><p>If the JVM is the engine and the JRE is the vehicle, the <strong>JDK is the full workshop</strong> — tools, machinery and everything needed to <strong>create</strong> Java programs.</p><h4><strong>What Does the JDK Contain?</strong></h4><p>The JDK includes:</p><p><strong><em>Java Compiler (</em></strong><strong><em>javac)</em></strong></p><ul><li>Converts Java source code (.java) into platform-independent <strong>bytecode</strong> (.class).</li><li>This is the core tool that makes Java’s portability possible.</li></ul><p><strong><em>JRE (Java Runtime Environment)</em></strong></p><ul><li>Contains the <strong>JVM + core libraries + runtime files</strong></li><li>Lets you <strong>run</strong> Java programs</li><li>The JDK includes the JRE so that developers can compile <strong>and</strong> run their code</li></ul><p><strong><em>Development Tools</em></strong></p><p>A set of utilities for building and analyzing Java applications:</p><ul><li>javap (bytecode disassembler)</li><li>javadoc (documentation generator)</li><li>jarsigner (sign JAR files)</li><li>jar (package Java classes)</li><li>jlink (Java 9+ module linker)</li><li>jpackage (create installable packages)</li></ul><p><strong><em>Debugging Tools</em></strong></p><ul><li>jdb (Java debugger)</li><li>jstack, jmap, jinfo (diagnostic tools)</li><li>Profilers and monitoring tools</li></ul><h4>Why is the JDK Needed?</h4><p>You need the JDK for:</p><ul><li>Writing Java code</li><li>Compiling .java → .class</li><li>Debugging</li><li>Packaging JARs</li><li>Generating documentation</li><li>Building production-ready applications</li></ul><h4>Is the JDK Platform Dependent? <strong>Yes.</strong></h4><ul><li>Windows JDK runs only on Windows</li><li>Linux JDK runs only on Linux</li><li>macOS JDK runs only on macOS</li></ul><p>But the <strong>bytecode</strong> it produces is platform-independent.</p><p>With this chapter, you now have a clear understanding of how the JDK, JRE and JVM work together to make Java portable, efficient and platform independent. These three components form the foundation of every Java program you will ever write or run.</p><p>In the <strong>next chapter</strong>, we’ll dive into one of the most fundamental building blocks of Java programming — <strong>Variables</strong>. We’ll explore what variables are, how they are stored in memory, the different data types Java supports and best practices every developer should practice.</p><p>If you found this chapter helpful, please do follow the series.</p><p><strong>🖋️ <em>Mastering Java — One Concept at a Time</em></strong><br> Thanks for reading. See you in the next chapter!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=775e46516db5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chapter 1 - What Is Java? A simple introduction for absolute beginners]]></title>
            <link>https://srinathvenkatramanan.medium.com/chapter-1-what-is-java-a-simple-introduction-for-absolute-beginners-7ce576ba1a1e?source=rss-82d840b78d2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ce576ba1a1e</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <dc:creator><![CDATA[Srinath Venkatramanan]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 19:15:17 GMT</pubDate>
            <atom:updated>2025-11-24T19:15:17.477Z</atom:updated>
            <content:encoded><![CDATA[<h3>Chapter 1 - What is Java? A simple introduction for absolute beginners</h3><h4>Mastering Java — One concept at a time</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OdaFgZqWrkp5vmKJOq7FrQ.png" /><figcaption>Mastering Java — One concept at a time</figcaption></figure><h4>Introduction</h4><p>If you’re starting your programming journey, Java is one of the best languages to begin with. It’s powerful, widely used, beginner-friendly and runs almost everywhere from smart devices and servers to Android phones and cloud environments.</p><p>In this article, we’ll quickly understand what Java is, why it’s so popular and where it’s used in today’s world. This is the first chapter in my <em>Mastering Java — One concept at a time</em> series, where I’ll walk through every core concept step-by-step in simple terms.</p><p>Let’s get started.</p><h4>What is Java?</h4><p>Java is a high-level, object-oriented, platform-independent programming language created by James Gosling at Sun Microsystems in 1995.</p><p>You can think of Java as a language that allows you to write logical instructions a computer can execute — just like English, but with rules.</p><p><strong><em>Some key features:</em></strong></p><p>✔ Simple — easy to learn compared to C/C++<br>✔ Object Oriented — everything revolves around objects<br>✔ Platform Independent — write once, run anywhere<br>✔ Secure — used in banking and enterprise systems<br>✔ Robust — strong memory management and error handling<br>✔ Multithreaded — can run many tasks at the same time</p><h4>Why is Java so popular?</h4><p>Java continues to dominate even in 2025 because:</p><ol><li><strong>Runs Everywhere — </strong>Java code compiles into bytecode, which runs on the JVM. This means the same Java program works on Windows, macOS, Linux, Android or the cloud.</li><li><strong>Huge Community &amp; Libraries —</strong> Whatever you want to build web apps, mobile apps, microservices — there’s already a Java framework for it.</li><li><strong>Strong Career Opportunities — </strong>Companies like Amazon, Netflix, Uber, LinkedIn, banks, telecom and government systems use Java heavily.</li><li><strong>Great for Beginners and Professionals — </strong>Beginners find it simple; experienced developers build large-scale systems with it.</li></ol><h4><strong>A simple Java program</strong></h4><p>Here’s your first Java program:</p><pre>public class HelloWorld {<br>    public static void main(String[] args) {<br>        System.out.println(&quot;Hello, Java!&quot;);<br>    }<br>}</pre><p>Try running this in any Java environment — you should see:</p><pre>Hello, Java!</pre><h4>Summary</h4><p>Java is a simple, powerful and widely adopted programming language used across industries. It forms the foundation for frameworks like Spring, microservices and even Android development.</p><p>In the upcoming chapters, I’ll break down each concept in a beginner-friendly way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ce576ba1a1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>