Appendix BAnswers to Review Questions

Chapter 1: Java Fundamentals

  1. A, D. Instance and static variables can be marked final, making option A correct. Effectively final means a local variable is not marked final but whose value does not change after it is set, making option B incorrect. The final modifier can be applied to classes, but not interfaces, making option C incorrect. Remember, interfaces are implicitly abstract, which is incompatible with final. Option D is correct, as the definition of a final class is that it cannot be extended. Option E is incorrect, as final refers only to the reference to an object, not its contents. Finally, option F is incorrect, as var and final can be used together.
  2. C. When an enum contains only a list ...

Get OCP Oracle Certified Professional Java SE 11 Programmer II Study Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.