OOPC
OOPC Concept mainly focus on
1) Inheritance
2) Polymorphism
3) Abstraction
4) Encapsulation
now lets start deep understanding of all oopc concept.
1) Inheritance
Inheritance is the process of creating new classes, called derived classes, from
base classes where an “is-a” relationship exists. The derived class extends from
the base class in order to inherit its propertiesCE142: OBJECT ORIENTED PROGRAMMING WITH C++ ID: 18DCE008
2) Polymorphism
Polymorphism is the ability of an object to take on many forms.
For example play sound() in this method if drum then parameter will be drum stick , if harmonium then parameter will be keys.
3) Abstraction
Abstraction in OOP refers to showing only the essential features of an object to the
user and hiding the other details to reduce complexity.
For example harmonium , It hides actual working , we just press the keys and listen sound , but actually bass will touce the air and generate voice which is hidden from us.
4) Encapsulation
Encapsulation in OOP refers to binding the data and the methods to manipulate that
data together in a single unit (class). This is normally done to hide the state and
representation of an object from outside.
For example , capsule medicine which bind upper layer and medicine together .
By Shraddha Mehta