Classical

Object Oriented Programming - Object Modelling

126:  
If an operator is normally defined to be only unary, then one
A.

may overload it to be binary

B.

must overload it to be binary

C.

may not overload it to be binary

D.

may not overload it

 
 

Option: D

Explanation :


127:  
When you overload an operator for use with your classes, you
A.

Must use the overloaded operator for the usual purpose

B.
should use the overloaded operator for the usual purpose
C.
may not use the overloaded operator for the usual purpose
D.
may not overload operators that have a usual purpose
 
 

Option: C

Explanation :


128:  

When you overload operators, you may change

A.

associativity

B.

precedence

C.

binary operators to unary ones

D.

none of these

 
 

Option: C

Explanation :


129:  

You overload an operator by naming it a

A.

variable

B.

built-in type

C.

function

D.

class

 
 

Option: C

Explanation :


130:  
Assuming you have properly overloaded the ! operator for a Number class, and that a and b are two members of the Number class, which expression is legal?
A.

!a

B.

b!

C.

a!b

D.

All of these

 
 

Option: A

Explanation :




Suggest an improvement