Operator Overloading  «Prev 
 
1. A user-defined type's public behavior should be dictated by
  A. the classes available in a library
  B. what is most efficient
  C. the most narrow construct that supports its needs
  D. expectations found in the community that uses it

2. When creating a mathematical ADT you should overload
  A. all possible mathematical operators
  B. all those mathematical operators that make sense for the class
  C. only those mathematical operators for which you have immediate use
  D. no operators--they are overloaded automatically by the compiler

3. Binary operators that are overloaded
  A. should generally be friend functions because this allows more natural use of the operators
  B. must be friend function. There is no other way to implement the overload.
  C. should generally be a member function because this provides the best privacy
  D. can be either friend or member function. Neither method is better.

Correct answers:

Your Score: 0