nerdexam
Oracle

1Z0-811 · Question #3

Identify two Java reserved words.

The correct answer is B. true. true is a Java reserved literal - along with false and null, it is built into the language specification and cannot be used as an identifier. Notably, this (C) is also a Java reserved word (it references the current object instance), so the full correct answer to "identify two"…

Java Basics

Question

Identify two Java reserved words.

Options

  • Aarray
  • Btrue
  • Cthis
  • Dexception

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    88% (30)
  • C
    6% (2)
  • D
    3% (1)

Explanation

true is a Java reserved literal - along with false and null, it is built into the language specification and cannot be used as an identifier. Notably, this (C) is also a Java reserved word (it references the current object instance), so the full correct answer to "identify two" is B and C.

The distractors work like this: array (A) is not a Java keyword - Java uses bracket syntax (int[]) rather than a dedicated array keyword, unlike some other languages. exception (D) is not reserved either; the relevant Java class is Exception (capitalized), which is a standard library class, not a language keyword.

Memory tip: If you can use it as a variable name without a compile error, it's not a reserved word. Try int true = 1; - the compiler rejects it immediately, confirming true is reserved. A quick mental check: Java's reserved words appear in most IDE editors highlighted in bold or a distinct color.

Topics

#reserved words#keywords#syntax basics#language fundamentals

Community Discussion

No community discussion yet for this question.

Full 1Z0-811 Practice