C++ Classes Quiz - 2

Question: 6

The class body has ___ access specifies.

(A) 1

(B) 2

(C) 3

(D) 4

Ans: C

3

Question: 7

The members declared as ____ can only be accessed within the class.

(A) Private

(B) Public

(C) Protected

(D) Class

Ans: A

Private

Question: 8

Class comprises ____

(A) Data members

(B) Member functions

(C) Both (a) and (b)

(D) None of these

Ans: C

Both (a) and (b)

Question: 9

When objects of a class are created, separate memory is allocated for?

(A) Member functions only

(B) Member variables only

(C) Both a and b

(D) Neither functions nor variables

Ans: B

Member variables only

Question: 10

The class access specifier used to access friend function is ____

(A) Private

(B) Public

(C) Protected

(D) Both (b) and (c)

Ans: B

Public

Related Questions