Object-Oriented Core Features
Encapsulation, Inheritance, and Polymorphism.
- Encapsulation: Encapsulation is a form of cohesion within an object's functionality that reduces coupling between modules and enhances maintainability. Its primary task involves hiding attributes, data, and sensitive internal behaviors.
- Inheritance: Inheritance allows subclasses to inherit from parent classes, acquiring some of the parent class's properties and methods, thereby improving module reusability.
- Polymorphism: Polymorphism refers to a situation where the final method body invoked cannot be determined at compile time; it is implemented based on overriding mechanisms for object-oriented features, with dynamic binding performed by the JVM during runtime to invoke the appropriate overridden method body.