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 3 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
Q29: A mouse event is generated by
A) moving
Q30: For the next questions, consider the following
Q32: Using the reserved word, super, one can
A)
Q33: For the next questions, consider the following
Q35: JApplet is an extension of the Applet
Q36: In order to implement the MouseListener interface,
Q37: A mouse event is a(n)
A) listener
B) object
C)
Q38: Consider an applet that implements MouseListener. Assume
Q39: The relationship between a parent class and
Q39: What is the advantage of using an
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents