OOps stands for Object Oriented Programming Language which provides the features of Class, Object, Encapsulation, Inheritance, Polymorphism, Abstraction.
1)Class
- Class is a Collection of object
- Class is a container, it contains both data members(variables) and member function(functions)
- Class is a logical representation used to create an object
- Memory is not allocated at the time of class declaration
Example
- Paper Plan
2)Object
- Any entity that has state and behavior is known as an object
- Object is a collection of instance variable and methods
- To access the class members, we have to define the object
- Memory is allocated at the time of object creation
- It is the pysical representation of class
Example
- Building, Table, Chair, pen
3)Encapsulation
- Wrapping of data members and member function in a single unit is called Encapsulation
Example
- Capsule is mixed of several medicines
4)Data Abstraction
- Displays only essential information to the user and hides the backend process
Example
- Phone - By using phone, we can make a call,take pictures, send mails but we don’t know how it’s done the process
5)Polymorphism
- Ability to have more than one forms
Example
- A person can have many characteristics - A girl can be both Student as well as employee
6)Inheritance
- Acquiring the property of new class from existing class
- It follows two concepts - Reusability & Extensibility
- Reusability - Use of old class in new class
- Extensibility - Adding new features to the existing class
Example
- We inherit the traits of our parents