CPP C++ Concepts

C++ Concepts

Before starting to learn C++ it is essential to have a basic knowledge of the concepts of Object oriented programming. Some of the important object oriented features are namely:

  • Objects
  • Classes
  • Inheritance
  • Data Abstraction
  • Data Encapsulation
  • Polymorphism

Objects

Objects are the basic unit of OOP.
They are instances of class, which have data members and uses various member functions to perform tasks.

Class

  • Class is similar to structures in C language.
  • Class can also be defined as user defined data type but it also contains functions in it.
  • So, class is basically a blueprint for object. It declare & defines what data variables the object will have and what operations can be performed on the class's object.

Inheritance

  • Inheritance is a way to reuse once written code again and again.
  • The class which is inherited is called base class & the class which inherits is called derived class.
  • So when, a derived class inherits a base class, the derived class can use all the functions which are defined in base class, hence making code reusable.

Data Abstraction

  • Data Abstraction increases the power of programming language by creating user defined data types.
  • Data Abstraction also represents the needed information in the program without presenting the details.

Data Encapsulation

  • It can also be said data binding. Encapsulation is all about binding the data variables and functions together in class.
  • Data Encapsulation combines data and functions into a single unit called Class.
  • When using Data Encapsulation, data is not accessed directly; it is only accessible through the functions present inside the class.
  • Data Encapsulation enables the important concept of data hiding possible.

Polymorphism

  • It is a feature, which lets us create functions with same name but different arguments, which will perform differently.
  • That is function with same name, functioning in different way.
  • Or, it also allows us to redefine a function to provide its new definition.

All these concept will explained in next tutorials.



Share This Page on:


Ask Question