Appendix AAnswers to Review Questions
Chapter 1: Java Building Blocks
- A, B, E. Option A is valid because you can use the dollar sign in identifiers. Option B is valid because you can use an underscore in identifiers. Option C is not a valid identifier because
true
is a Java reserved word. Option D is not valid because the dot (.) is not allowed in identifiers. Option E is valid because Java is case sensitive, soPublic
is not a reserved word and therefore a valid identifier. Option F is not valid because the first character is not a letter, $, or _. - D. Boolean fields initialize to
false
and references initialize tonull
, soempty
isfalse
andbrand
isnull
.Brand = null
is output. - B, D, E. Option A (line 4) compiles because
short
is an integral ...
Get OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808 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.