Appendix BAnswers to Review Questions
Chapter 1: Java Fundamentals
- A, D. Instance and
static
variables can be markedfinal
, making option A correct. Effectivelyfinal
means a local variable is not markedfinal
but whose value does not change after it is set, making option B incorrect. Thefinal
modifier can be applied to classes, but not interfaces, making option C incorrect. Remember, interfaces are implicitlyabstract
, which is incompatible withfinal
. Option D is correct, as the definition of afinal
class is that it cannot be extended. Option E is incorrect, asfinal
refers only to the reference to an object, not its contents. Finally, option F is incorrect, asvar
andfinal
can be used together. - 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.