Object Oriented Programming(OOP) concepts in C++

 

Object Oriented Programming(OOP) concepts in C++


Object oriented programming is a way of solving complex problems by breaking them into smaller problems using objects. The OOP is all about creating objects that can interact with each other, this makes it easier to develop programs in OOP. If any programming language follows the below oops concept then that language called object oriented programming language.

  • Object
  • Class
  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

Object

Object is the physical as well as logical entity where as class is the only logical entity.
It is a basic unit of Object-Oriented Programming and represents the real-life entities. A C++ program creates many objects which interact by invoking methods.

Class

Class: Class is a blue print which is containing only list of variables and method and no memory is allocated for them. A class is a group of objects that has common properties.
A class is a user-defined blueprint or prototype from which objects are created. It represents the set of properties or methods that are common to all objects of one type.

Encapsulation

Encapsulation is a process of wrapping of data and methods in a single unit is called encapsulation. Encapsulation is achieved in C++ language by class concept. The main advantage of using of encapsulation is to secure the data from other methods, when we make a data private then these data only use within the class, but these data not accessible outside the class.

Abstraction

Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context.

The hiding of data is known as data abstraction. In object oriented programming language this is implemented automatically while writing the code in the form of class and object.

Inheritance

The process of obtaining the data members and methods from one class to another class is known as inheritance. It is one of the fundamental features of object-oriented programming.

Polymorphism

The process of representing one Form in multiple forms is known as Polymorphism. Here one form represents an original form of the original method that always resides in the base class and multiple forms represents the overridden method that resides in derived classes.

Comments