Java Master Tutorial chapters
  1. 01Introduction & JVM Architecture
  2. 02Data Types, Variables & Type Conversion
  3. 03Operators & Control Flow
  4. 04Object-Oriented Programming (OOP) Core
  5. 05Inheritance & Polymorphism
  6. 06Abstraction & Interfaces
  7. 07Memory Management & Garbage Collection
  8. 08Strings & String Pool
  9. 09Exception Handling
  10. 10Java Collections Framework
  11. 11Multithreading & Concurrency
  12. 12Java 8 Features & Streams

Chapter 4

Object-Oriented Programming (OOP) Core

4 topics in 1 parts

Key ideas

Input Size (n) → Time (T) ↑ O(1) O(log n) O(n) O(n log n) O(n²) O(2ⁿ)
Object-Oriented Programming (OOP) Core
ComponentJVM StackJVM Heap Space
Storage ContentMethod frames, primitive local variables, object referencesAll created object instances and arrays
Thread SafetyThread-isolated (strictly private to thread)Globally shared across all application threads
LifecycleCreated on method entry, popped on returnManaged by Garbage Collector (G1 / ZGC)
Memory ErrorStackOverflowError (deep recursion)OutOfMemoryError: Java heap space

All 4 topics in Object-Oriented Programming (OOP) Core

  1. OOP

    • Classes, Objects & new Keyword
    • Constructors & this Reference
    • Method Overloading & Varargs
    • static Keyword in Java