Characteristics of OOP in JAVA
- Objects
- Classes
- Inheritance
- Encapsulation
- Data abstraction
- Polymorphism
Object
An object has states(properties) and behavior (set of tasks performed by an object).Any real world entity like a chair, pen, table, keyboard, bike, etc. It can be physical or logical.
Example
A dog is an object because ithas states like color, name, breed etc.as well as behaviors like wagging the tail, barking, eating, etc.
Class
Blueprint of an object.A class can have multiple objects.It is a logical entity.
Example:
A student class can have many objects like student1,student2,student3 etc.
Inheritance
When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism.
Encapsulation
Binding (or wrapping) code and data together into a single unit are known as encapsulation.

Example:
A capsule, it is wrapped with different medicines.
Data Abstraction

Example :
phone call, we don't know the internal processing and ATM don't show the internal processing.
Polymorphism
If one task is performed in different ways, it is known as polymorphism. In Java, we use method overloading and method overriding to achieve polymorphism.
Example:
to draw polygon can be anything like draw triangle, draw rectangle, draw square etc.
More will come idea if you watch this video:-
0 Comments