What are the basic concepts of object oriented programming?

C++ is an object oriented programming (OOP), hence it follows the basic concepts of OOP, such as the concept of Class and Objects. It also supports all the other basic concepts associated with them such as Inheritance, Polymorphism, Abstraction, Encapsulation, etc.

Classes and Objects: Classes specify the structure of the data. They also define data type. Objects are created from classes. They are the instances of classes.

Inheritance: Inheritance is used to inherit the property of one class into another class. Basically, it allows the defining of one class in the context of another.

Polymorphism: Polymorphism means ability to take more than one form. Hence, in C++, operations may take on different behaviors in different instances depending on the types of data used in the operation.

Abstraction: Abstraction is used to hide the internal implementations of the program. Hence, only the necessary detail will be visible to others. Data abstraction is implemented using interfaces and abstract classes in C++.

Encapsulation: Encapsulation is also known as data hiding. It allows the data and associated operations to be bound together and thus hiding the data from different classes.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.