The fundamental idea behind object-oriented languages is to combine both data and the function into a single unit. Such a unit is called an object.

An object’s functions , called member functions in C++, typically provides the only way to access it data.

If you want to read a data item in an object, you call member function in the object.

It will access the data and return the value to you. you  can’t access the data directly.

The data is hidden, so it safe from accidental alteration. Data and its functions are said to be encapsulated into a single entity. Data encapsulation and data hiding are key terms in the description of object oriented languages.

If you want to modify the data in an object, you know exactly what function interacts with it, the member functions in the objects.

This simplifies writing,debugging and maintaining the program.

A C++ program typically consists of number of objects, which communicate with each other by calling one another’s member functions.

Object-oriented programming is not primarily concerned with the details of program.

Instead it deals with the overall organization of the program.

Comments are closed.