Classical

Object Oriented Programming - Object Modelling

101:  

A function can

A.

be granted friendship by a class you create

B.

declare itself to be a friend of your class

C.

grant friendship to another function

D.

grant friendship to a class created

 
 

Option: A

Explanation :


102:  
When a nonmember function needs to refer to instances of two different classes, then
A.

only one class may grant friendship  to the function

B.

Both the classes must  grant friendship  to the function

C.

Either may grant friendship  to the function

D.

Neither  class may grant friendship  to the function

 
 

Option: B

Explanation :


103:  
When a non-member function needs to refer to instances of two different classes, then
A.

store the classes in separate files

B.

make the classes friends of one another

C.

make a forward reference to one of the classes.

D.

make a forward reference to both of the classes.

 
 

Option: C

Explanation :


104:  

A forward reference

A.

defines a class

B.

eliminates the need to define a class

C.

acknowledges the existence of a class

D.

is illegal in object-oriented programming.

 
 

Option: A

Explanation :


105:  
If four classes had the same friend function, then forward declare
A.

nothing

B.

one class

C.

two classes

D.

three classes

 
 

Option: D

Explanation :




Suggest an improvement