Classloader Subsystem: Loads, links, and initializes .class bytecode files into memory.
Method Area / Metaspace: Stores class-level data, static variables, and method metadata.
Heap Memory: Stores all instantiated Objects and instance variables. (Managed by Garbage Collector).
Java Stack: Stores frame frames per thread, local variables, and partial results (LIFO structure).
JIT (Just-In-Time) Compiler: Compiles frequently executed bytecode ("hot spots") directly into native machine code at runtime for high performance.
Garbage Collector (GC): Automatically reclaims heap memory occupied by unreferenced objects using Mark-and-Sweep algorithms.
2. Access Modifiers Truth Table
Java has 4 access levels governing visibility across packages and subclasses:
Modifier
Same Class
Same Package
Subclass (Diff Package)
World (Everywhere)
private
✅ Yes
❌ No
❌ No
❌ No
default (package-private)
✅ Yes
✅ Yes
❌ No
❌ No
protected
✅ Yes
✅ Yes
✅ Yes (via inheritance)
❌ No
public
✅ Yes
✅ Yes
✅ Yes
✅ Yes
💡 Examiner Distinction Tip
Notice that protected allows access to subclasses in different packages, but ONLY through inheritance (not via instance reference of parent in a different package).
3. Non-Access Modifiers (static & final)
A. The static Keyword
Belongs to the Class itself, not to individual object instances.
Shared across all instances of the class (stored in Method Area/Metaspace).