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 2 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
Q2: Interface classes cannot be extended but classes
Q22: If you instantiate an Abstract class, the
Q23: For the questions below, assume that Student,
Q24: Which of these is correct?
A) a base
Q25: Why shouldn't an abstract method be declared
Q28: A derived class has access to all
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)
Q39: The relationship between a parent class and
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