C++ basic interview questions and answers pdf - 1

Question: 1

What is a class?

A class is a new way of creating and implementing a user defined data type.

Classes provide a method for packing together data of different types.

Question: 2

What are the two parts of a class specification?

A class specification has two parts:

Class declaration

Class function definitions

Question: 3

What is encapsulation?

The binding of data and functions together into a single entity is referred to as encapsulation.

Question: 4

What is mean by data hiding?

The members and functions declared under private are not accessible by members outside the class, this is referred to data hiding.

Question: 5

What does the following statement mean?

Void add :: show ()

The statement means that function show () is a member of the class add. And the function does not return any data type.

Related Questions