Object Oriented Programming - Object Modelling

16:  
Assuming that properly overloaded the *operator to perform multiplication for a Number class, and that a, b, and c are three members of the Number class, which expression is legal?
A.

a*b

B.

a*b*c

C.

Both (a) and (b)

D.

None of these

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here:



17:  
When an operator is used alone with a single variable argument, the operator is called
A.

unique

B.

unary

C.

alone

D.

allocated

 
 

Option: B

Explanation :

Click on Discuss to view users comments.

Write your comments here:



18:  
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 :

Click on Discuss to view users comments.

Write your comments here:



19:  
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 :

Click on Discuss to view users comments.

Write your comments here:



20:  

When you overload operators, you may change

A.

associativity

B.

precedence

C.

binary operators to unary ones

D.

none of these

 
 

Option: C

Explanation :

Click on Discuss to view users comments.

Write your comments here: