1.
Basics of OOP in Java
Classes and Objects
Defining a class
Creating objects
Class members (fields, methods, constructors)
Constructors
Default constructor
Parameterized constructor
Constructor overloading
this keyword
Static and Instance Members
static keyword (variables, methods, blocks)
Difference between static and instance members
2. Four Pillars of OOP
a) Encapsulation
Data hiding using private access modifier
Getters and setters
Benefits of encapsulation
b) Inheritance
Types of inheritance in Java:
Single inheritance
Multilevel inheritance
Hierarchical inheritance
(Java does not support multiple inheritance with classes)
super keyword (calling parent class constructor/methods)
Method overriding
c) Polymorphism
Compile-time (Method Overloading)
Methods with the same name but different parameters
Runtime (Method Overriding)
Overriding a method in a subclass
@Override annotation
Upcasting and Downcasting
d) Abstraction
Abstract classes (abstract keyword)
Abstract methods
Interfaces (interface keyword)
Difference between abstract class and interface
3. Advanced OOP Topics
Final Keyword (final with variables, methods, and classes)
Access Modifiers (public, private, protected, default)
Inner Classes (Nested classes, static inner classes, anonymous classes)
Interfaces vs Abstract Classes
Multiple Inheritance using Interfaces
Object Cloning (clone() method and Cloneable interface)
4. Miscellaneous OOP Concepts
this Keyword (Referring to the current object)
super Keyword (Accessing parent class members)
Method Overriding and Dynamic Method Dispatch
Instance Initializer Blocks ({} block in a class)
Composition and Aggregation (Has-a relationship)