6. 4. Characteristics / Features of OOP
1. Abstraction – hiding the internal details
2. Encapsulation – binding data and methods together into a
single unit called “class”
3. Inheritance – ability of a class to derive the features of other
class
4. Polymorphism – Ability to exhibit “many forms”
7. What is a Class?
1. It is a blue print of an Object
2. It is just like a mold
3. It doesn’t have life.
Ex : Student is a class
8. What is a Class?
1. It is a ________ of an Object
2. It is just like a ____
3. It doesn’t have ________
Ex : Student is a class / object
9. What is an Object?
1. It is an instance of a class
2. It is the one which fills the class
3. It has life
Ex : Ram is a Student
Ram – object
Student - Class
10. Some Examples – Class - Java
Examples of states and behaviors
Example 1:
Object: House
State: Address, Color, Area
Behavior: Open door, close door
11. Some Examples – Class - Java
Object: Car
State: Color, Brand, Weight, Model
Behavior: Break, Accelerate, Slow Down,
Gear change.