OOPortal
Technology
Search
SiteMap
J2EEOnline
RationalDB
Building C++ Classes
Corba Fundamentals
Corba Java Programming
Designing Reusable Code
Programming C++
Structured Programming
Reusable Code
Ad Hoc Polymorphism
Operator Overloading
Inheritance Pure Polymorphism
Operator overloading
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.
Score =
Correct answers:
Explanation