Chapter 4
Object-Oriented Programming (OOP) Core
4 topics in 1 parts
Key ideas
| Component | JVM Stack | JVM Heap Space |
|---|---|---|
| Storage Content | Method frames, primitive local variables, object references | All created object instances and arrays |
| Thread Safety | Thread-isolated (strictly private to thread) | Globally shared across all application threads |
| Lifecycle | Created on method entry, popped on return | Managed by Garbage Collector (G1 / ZGC) |
| Memory Error | StackOverflowError (deep recursion) | OutOfMemoryError: Java heap space |
All 4 topics in Object-Oriented Programming (OOP) Core
OOP
- Classes, Objects & new Keyword
- Constructors & this Reference
- Method Overloading & Varargs
- static Keyword in Java