Classical

Object Oriented Programming - Object Modelling

96:  
You can bestow friendship on all members of another class by
A.

making each function a friend

B.

making a friend of the entire class

C.

either (a) or (b)

D.

None of these

 
 

Option: C

Explanation :


97:  
To display two private data members from one object of a class,
A.
create a member function to preserve data hiding
B.
create a friend function to implement object oriented programming
C.
create both friend and member functions to give the programmer a choice
D.
not create a function, but just display the data members directly.
 
 

Option: A

Explanation :


98:  
A function that can access private members of a class, even though it is not a member of the class itself, is
A.

A Friend

B.

an inline function

C.

a private function

D.

never allowed in object oriented programming.

 
 

Option: A

Explanation :


99:  

Select the correct statement of the following?

A.
When you create a functon, you can declare it to by a friend function.
B.
When you create a friend function, you must include the friend keyword in the function header.
C.

Both (a) and (b)

D.

None of these

 
 

Option: B

Explanation :


100:  

Select the correct statement of the following?

A.
A class declaration must state which functions will be its friends
B.
A friend function must declare to which classes it will be a friend
C.

Both (a) and (b)

D.

None of these

 
 

Option: A

Explanation :




Suggest an improvement