December 2019
Intermediate to advanced
608 pages
14h 4m
English
B. The code compiles successfully, so options D and E are incorrect. The value of a cannot be changed by the addToInt() method, no matter what the method does, because only a copy of the variable is passed into the parameter x. Therefore, a does not change, and the output on line 9 is 15. For more information, see Chapter 7.
C, D, E. The program contains three compiler errors. First, the method getTailLength() in the interface HasTail is implicitly to be public, since it is an abstract interface method. Therefore, line 3 does not compile since it is an invalid override, reducing the visibility of the method, making option C correct. Next, the class Cougar implements an overloaded version of getTailLength() ...
Read now
Unlock full access