Multiple Choice
For the questions below, assume that Student, Employee and Retired are all extended classes of Person, and all four classes have different implementations of the method getMoney. Consider the following code where ... are the required parameters for the constructors:
Person p = new Person(...) ;
int m1 = p.getMoney( ) ; // assignment 1
p = new Student(...) ;
int m2 = p.getMoney( ) ; // assignment 2
if (m2 < 100000) p = new Employee(...) ;
else if (m1 > 50000) p = new Retired(...) ;
int m3 = p.getMoney( ) ; // assignment 3
-The reference to getMoney( ) in assignment 1 is to the class
A) Person
B) Student
C) Employee
D) Retired
E) none of the above, this cannot be determined by examining the code
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Abstract methods are used when defining<br>A) interface
Q6: Java does not support multiple inheritance but
Q36: What is the advantage of extending an
Q37: Consider an applet that implements MouseListener. Assume
Q39: An Applet implements MouseMotionListener and is 600x600
Q40: If you instantiate an Abstract class, the
Q43: Assume a class Triangle has been defined.
Q44: For the questions below, use the following
Q45: Clicking the mouse button generates three mouse
Q46: An Applet implements MouseMotionListener. Write the mouseMoved