This appendix provides annotated answers to the questions in the mock exam for the Java SE 8 Programmer I certification found in Appendix E.
Q1 (a), (b), (c), and (e)
Only local variables need to be explicitly initialized before use. Fields are assigned a default value if not explicitly initialized.
(2, 3) to the method
substring() constructs a string consisting of the characters from index 2 (inclusive) to index 3 (exclusive) of the original string; that is, the string returned contains the character at index 2. The first character is at index 0 and the last character is at index 1 less than the number of characters in the string.
The loop prints ...