C++ Object Oriented concepts


C++ is an Object Oriented Programming language, here we will discuss the concepts of C++ that are not present in C, also assuming that readers already having knowledge on C language.

Object:
This is the basic unit of object oriented programming. That is both data and function that operate on data are bundled as a unit called as object.


Class:
definition of a class is a blueprint for an object. This doesn't actually define any data, but it does define what the class name means, that is, what an object of the class will consist of and what operations can be performed on such an object.

more >> about Object & Class

Abstraction:
Data abstraction refers to, hiding the data that does not share with the outside world, using access specifiers on the class members (Access specifiers: public, private & Protected)

more >> about Abstraction 

Encapsulation:
Encapsulation is placing the data and the functions that work on that data in the same place. While working with procedural languages, it is not always clear which functions work on which variables but object-oriented programming provides you framework to place the data and the relevant functions together in the same object.


Inheritance:
One of the most useful aspects of object-oriented programming is code reusability. As the name suggests Inheritance is the process of forming a new class from an existing class that is from the existing class called as base class, new class is formed called as derived class.
This is a very important concept of object oriented programming since this feature helps to reduce the code size.
more >> about Inheritance

Polymorphism:
The ability to use an operator or function in different ways in other words giving different meaning or functions to the operators or functions is called polymorphism. Poly refers many. That is a single function or an operator functioning in many ways different upon the usage is called polymorphism.

more >> about Polymorphism

Overloading:
The concept of overloading is also a branch of polymorphism. When the exiting operator or function is made to operate on new data type it is said to be overloaded.

more >> about overloading

No comments:

Post a Comment