Classes and Objects in C++ Programming Questions and Answers - 3

Question: 11

Data hiding refers to _____

(A) not giving names to data

(B) not specifying members and functions of a class

(C) declaring members as public

(D) members and functions of a class are not accessible by members of outside class

Ans: D

members and functions of a class are not accessible by members of outside class

Question: 12

The class members declared _____ can be accessed only within the class and the members of the inherited classes.

(A) protected

(B) unprotected

(C) public

(D) private

Ans: A

protected

Question: 13

Declaration of class member are declared as private can be accessed only

(A) separately in another class

(B) inside or outside the class

(C) outside the class

(D) within class

Ans: D

within class

Question: 14

The private data of a class can be accessed

(A) only by member functions of its own class and friend functions

(B) only by member functions of its own class

(C) only by friend functions

(D) by any function

Ans: A

only by member functions of its own class and friend functions

Question: 15

The member functions declared under which scope can be accessed by the objects.

(A) protected

(B) global

(C) private

(D) public

Ans: C

private

Related Questions