AppendixAnswers to the Review Questions
Chapter 1: Building Blocks
- D, E. Option E is the canonical
main()
method signature. You need to memorize it. Option D is an alternate form with the redundantfinal
. Option A is incorrect because themain()
method must be public. Options B and F are incorrect because themain()
method must have avoid
return type. Option C is incorrect because themain()
method must bestatic
. - C, D, E. The
package
andimport
statements are both optional. If both are present, the order must bepackage
, thenimport
, and thenclass
. Option A is incorrect becauseclass
is beforepackage
andimport
. Option B is incorrect becauseimport
is beforepackage
. Option F is incorrect becauseclass
is beforepackage
. - A, E. ...
Get OCP Oracle Certified Professional Java SE 17 Developer 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.