Object Oriented Programming
- C++ programming language fully supports object-oriented concepts.
- The main characteristics of Object-Oriented Programming languages are
- Data abstraction
- Data Encapsulation
- Data abstraction means representing the features of a system without delivering or representing the background details.
- Working on a computer system without including the background details.
- Working of Motor-vehicle without including the background details.
- Data encapsulation is also known as data hiding, which means data hides the associated code and protect it from external misuse.
- Another feature of data encapsulation is the implementation details of the class are kept hidden from the external world.
- Data encapsulation encapsulates the data and functions into a single unit.
- suppose you want to find the average of three numbers. The instructions to read these three numbers constitute the data and include functions for inputting the data, processing, and output. The data and functions constitute a single unit called class.
- Inheritance is the property of inheriting the characteristics from the base class or from the existing class.
- In object-oriented programming, Inheritance is the concept that the process of creating new classes called derived classes from the existing or base classes.
- The derived class inherits all the capabilities of the base class.
- We ourselves are an example of these. Technically we are derived from our parents and they are derived from their grandparents and so on. The derived class is always bigger than the base class.
- Polymorphism is the property of representing the same thing differently in different conditions.