OOP concepts in Java:

java dev.to

1. Object
An object is an instance of a class. It represents a real-world thing and contains data (variables) and behavior (methods).

2. Class
A class is a blueprint/template used to create objects.

3. Encapsulation
Encapsulation means wrapping data and methods into one unit (class) and protecting data using access modifiers.

4. Abstraction

 Abstraction means hiding implementation details and showing only important information.
Enter fullscreen mode Exit fullscreen mode

5. Polymorphism
Polymorphism means one thing having many forms.

6.Inheritance
Inheritance is an OOP concept where one class acquires (inherits) properties and methods of another class.

Short Interview Definition:

  • Class: Blueprint for creating objects

  • Object: Instance of a class

  • Encapsulation: Binding data and methods together

  • Abstraction: Hiding internal details

  • Polymorphism: One name, multiple behaviors

Source: dev.to

arrow_back Back to Tutorials