Vermeg interview question

Can you explain the four main principles of Object-Oriented Programming in Java?

Interview Answer

Anonymous

30 Jun 2026

The four main OOP principles are encapsulation, inheritance, polymorphism, and abstraction. Encapsulation protects data by controlling access through methods. Inheritance allows a class to reuse and extend another class. Polymorphism enables the same method to behave differently depending on the object's type. Abstraction hides implementation details and exposes only the necessary functionality through abstract classes or interfaces.