On Day 3, we went deeper into:
JRE inside JVM
JVM and OS independence
Data Types
Memory concepts (Stack)
Variables & memory allocation
This was a very important foundation day.
π JVM and OS Independence
We learned that:
JVM makes Java platform independent
Java programs can run on Windows, Linux, or Mac
Only JVM needs to be installed for that OS
Thatβs why Java is called:
βWrite Once, Run Anywhereβ
*πΉ 1. Overview *
When you write Java code, several components work together to compile and run it:
JDK β Development kit (for developers)
JRE β Runtime environment (to run Java programs)
JVM β Engine that executes Java bytecode
JIT β Performance booster inside JVM
πΉ 2. Detailed Explanation
β
JDK (Java Development Kit)
It is the full package for developers
Contains:
Compiler (javac)
JRE
Debugging tools
Used to develop, compile, and run Java programs
π Think: βI want to create Java programsβ β You need JDK
β
JRE (Java Runtime Environment)
It provides the environment to run Java programs
Contains:
JVM
Core libraries (like java.lang, java.util)
Does NOT include compiler
π Think: βI only want to run Java programsβ β JRE is enough
β
JVM (Java Virtual Machine)
It is the engine that runs Java bytecode
Converts bytecode β machine code
Platform-dependent (different JVM for Windows, Linux, etc.)
π Key role:
Memory management
Garbage collection
Security
π Think: βExecutor of Java codeβ
β
JIT (Just-In-Time Compiler)
It is a part of JVM
Improves performance by:
Converting bytecode β native machine code at runtime
Avoids repeated interpretation
π Think: βOptimizer inside JVMβ
| Component | Full Form | Purpose | Contains | Independent? | Used By |
| --------- | ------------------------ | ------------------------------------- | ---------------------- | ----------------- | ---------- |
| **JDK** | Java Development Kit | Develop + Compile + Run Java programs | JRE + Compiler + Tools | β
Yes | Developers |
| **JRE** | Java Runtime Environment | Run Java programs | JVM + Libraries | β No (inside JDK) | End Users |
| **JVM** | Java Virtual Machine | Executes bytecode | JIT + Memory mgmt | β No (inside JRE) | System |
| **JIT** | Just-In-Time Compiler | Improves performance | Native code generator | β No (inside JVM) | JVM |
π¦What is a Data Type?
A Data Type defines:
What kind of value can be stored
How much memory it uses
Examples of values:
Numeric values (10, 100)
Decimal values (10.5, 20.75)
Special characters ('A', '@')
True/False
Think of a data type as a container.
You must choose the correct container for the value you store.
π§© Two Types of Data Types in Java
1οΈβ£ Primitive Data Types
These store simple values directly.
Data Type Size Example
byte 1 byte 50
short 2 bytes 1000
int 4 bytes 100000
long 8 bytes 100000000L
float 4 bytes 10.5f
double 8 bytes 10.5678
char 2 bytes 'A'
boolean 1 bit (logical) true/false
π§ Understanding byte
1 byte = 8 bits
2^8 = 256 values
Range of byte:
-128 to 127
So this is valid:
byte tamilMark = 50;
byte englishMark = 50;
But this is NOT valid:
byte value = 200; // β Out of range
2οΈβ£ Non-Primitive Data Type
These store references (not direct values).
Example:
String name = "Kaveri";
String can store multiple characters.
We will study String in detail separately (very important topic).
π§ Primitive vs Non-Primitive (Major Difference)
** Primitive Non-Primitive**
Stores actual value Stores reference (address)
Fixed size Size depends on object
Stored in stack Stored in heap (reference in stack)
Example: int, byte Example: String
π§ Memory Concept (Simple Understanding)
We learned about:
πΉ** Stack Memory**
Stores primitive variables
Stores variable references
Example:
int tamil = 70;
Here:
int β data type
tamil β variable name
= β assignment operator
70 β value
; β end of statement
π· What is a Variable?
Variable = Name of the memory location.
Example:
byte tamil_mark = 70;
byte eng_mark = 60;
Just like two students cannot have the same roll number,
Java does not allow duplicate variable names in the same scope.
π§ Breaking Down This Line
byte tamil_mark = 70;
byte β data type
tamil_mark β variable name
= β assignment operator
70 β value
; β statement terminator
The semicolon tells Java:
The line of code is complete.
π» Checking System RAM
We also learned how to check system memory:
Right-click This PC
Click Properties
View installed RAM
Memory matters because:
JVM uses system memory
Applications allocate memory during runtime
π―** Day 3 Reflection**
Today I understood:
β What data types are
β Difference between primitive and non-primitive
β Memory basics (Stack concept)
β Why variable names must be unique
β How byte range is calculated
Strong fundamentals in Java will directly help in:
Selenium automation
Handling test data
Writing efficient scripts
Every day, Iβm getting one step closer to my goal:
π Becoming a Master in Automation Testing using Selenium and Playwright.
π€ A Small Note
I used ChatGPT to help structure and refine this blog while ensuring the concepts remain aligned with my trainerβs explanations.

Top comments (0)