March 2023
Intermediate to advanced
1851 pages
66h 25m
English
This appendix provides annotated answers to the questions in the mock exam for the Java SE 17 Developer exam found in Appendix E, p. 1709.
Q1 (e)
An object of the class Extension is created. The first thing the constructor of Extension does is invoke the constructor of Base, using an implicit super() call. All calls to the method void add(int) are dynamically bound to the add() method in the Extension class, since the actual object is of type Extension. Therefore, this method is called by the constructor of Base, the constructor of Extension, and the bogo() method with the parameters 1, 2, and 8, respectively. The instance field i changes value accordingly: 2, 6, and 22. The final ...
Read now
Unlock full access