- Class - A Class is a user defined datatype and it is known as reference type.
- Object - An object is used to represent the class. An object is defined as instance of a class.
- OOPS(object oriented programming)-- > Any Programming language to become a object oriented should follow the following features apart from the class and object.
a.Abstraction (Hidding of complexity)
b.Encapsulation (Hiding the data)
c.Polymorphism
d.Inheritance (Reusability)
Abstraction- It is a process of Hiding the implementation but providing a services. there are two types of Abstraction available:
- Data Abstraction
- Functional Abstraction
e.g of Abstraction is NAMESpace. Because in namespace is a base class libraries in which certain code is written how to work this namespace but we only use namespace and nothing know about its complexity and how it is create.
Encapsulation---> It's a process of Binding the member variable of a class along with member functions.Encapsulation Can be implemented with the help of object and Also access modifier like Private, public, Protected etc.
e.g of Encapsulation is Class. Polymorphism - it is an approach of behaving in the different ways whenever the input changes, the behaviour of output is also changed accordingly.
e.g of polymorphism is Exam Result.
polymorphism are of two types,- Compile time plymorphism/Early binding/ Static polymorphism.
- Runtime polymorphism/ Late Binding/ Dynamic polymorphism.
Inheritance---->> It is a concept of acquiring the parents property by the children for reusing them, same as this, the member of a class in a object oriented programming can be consumed in a new class by esablishing parent/child relationship between the class.
Inheritance are five types.
- Single Inheritance
- Multiple Inheritance
- Multilevel Inheritance
- Hybrid Inheritance
- Hierarichal Inheritance