C++ basic interview questions and answers pdf - 2

Question: 6

What is data abstraction?

Instruments allowing only selected access of components to objects and to members of other classes is called data abstraction.

Question: 7

What effect does the visibility label protected, has on the members of a class?

The members that have been declared as protected can be accessed from within the class, and from the members of the inherited classes.

Question: 8

Write the characteristics of member functions?

Data members are the data variables that represent the features or properties of a class.

Member functions are the functions that perform specific tasks in a class.

Member functions are called as methods, and data members are also called as attributes.

Question: 9

What effect does the visibility label public, has on the members of a class?

The members that have been declared as public can be accessed from outside the class also

Question: 10

What effect does the visibility label private has on the members of a class?

The members that have been declared as private, can be accessed only from within the class.

Related Questions