Question 454 of 509
Java Basics and SyntaxhardMultiple SelectObjective-mapped

Quick Answer

The answer is myVar123, as it is a valid Java identifier that follows all the rules defined by the Java Language Specification. Java identifiers must begin with a letter, an underscore (_), or a dollar sign ($), and subsequent characters can include any of those plus digits (0-9); myVar123 starts with a letter and contains only letters and digits, making it perfectly compliant. On the Oracle Java Foundations 1Z0-811 exam, this concept tests your understanding of the exact set of allowed starting and subsequent characters, often appearing in multiple-choice questions that mix valid and invalid examples. A common trap is assuming that digits can start an identifier or that special characters like @ or # are allowed, so remember that only $ and _ are permitted as non-alphanumeric starting symbols. For a quick memory tip, think of the mnemonic "LUD$" — Letters, Underscores, and Dollars are the only ways to begin a valid Java identifier.

1Z0-811 Java Basics and Syntax Practice Question

This 1Z0-811 practice question tests your understanding of java basics and syntax. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Which THREE are valid Java identifiers? (Choose three.)

Question 1hardmulti select
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

$dollar

Option A is correct because Java identifiers can start with a dollar sign ($), which is a valid identifier character according to the Java Language Specification (JLS). The $dollar follows the rule that identifiers must begin with a letter, underscore, or dollar sign, and subsequent characters can include letters, digits, underscores, or dollar signs.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • $dollar

    Why this is correct

    Starts with dollar sign, valid.

    Related concept

    Read the scenario before looking for a memorised answer.

  • my var

    Why it's wrong here

    Contains space, invalid.

  • 2ndValue

    Why it's wrong here

    Starts with digit, invalid.

  • _value

    Why this is correct

    Starts with underscore, valid.

    Related concept

    Read the scenario before looking for a memorised answer.

  • myVar123

    Why this is correct

    Valid combination of letters and digits.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Oracle often tests the rule that identifiers cannot start with a digit, leading candidates to mistakenly think '2ndValue' is valid because it contains letters, while overlooking the initial digit violation.

Detailed technical explanation

How to think about this question

Under the hood, Java identifiers are defined by the JLS §3.8, which specifies that identifiers must start with a Java letter (which includes Unicode letters, underscore, and dollar sign) and can be followed by Java letters or digits. The dollar sign is often used in generated code (e.g., inner class names like Outer$Inner) or by tools, but it is not recommended for user-defined identifiers due to potential confusion. Real-world scenarios include naming variables in financial applications where $dollar might be used for currency-related fields, though it is unconventional.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A practitioner preparing for the 1Z0-811 exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related 1Z0-811 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 1Z0-811 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 1Z0-811 question test?

Java Basics and Syntax — This question tests Java Basics and Syntax — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: $dollar — Option A is correct because Java identifiers can start with a dollar sign ($), which is a valid identifier character according to the Java Language Specification (JLS). The $dollar follows the rule that identifiers must begin with a letter, underscore, or dollar sign, and subsequent characters can include letters, digits, underscores, or dollar signs.

What should I do if I get this 1Z0-811 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

3 more ways this is tested on 1Z0-811

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which TWO of the following are valid Java identifiers? (Choose two.)

easy
  • A.my-var
  • B.$value
  • C._myVariable
  • D.2ndPlace
  • E.class

Why B: In Java, identifiers must start with a letter, underscore, or dollar sign, and subsequent characters can include digits. Reserved words cannot be used. _myVariable and $value are valid. 2ndPlace starts with a digit, my-var contains a hyphen, and class is a reserved word.

Variation 2. Which TWO are valid identifiers in Java? (Choose two.)

medium
  • A.$money
  • B.123abc
  • C._value
  • D.2ndPlace
  • E.my-var

Why A: Option A is correct because in Java, identifiers can begin with a letter, an underscore (_), or a dollar sign ($). The dollar sign is a valid starting character, so '$money' is a legal identifier. This is specified in the Java Language Specification (JLS §3.8).

Variation 3. Which TWO are valid Java identifiers? (Choose two.)

easy
  • A.$test
  • B.class
  • C.my-var
  • D._myVar
  • E.2ndVar

Why A: Option A ($test) is a valid Java identifier because identifiers can begin with a dollar sign ($) or an underscore (_), followed by any combination of letters, digits, dollar signs, or underscores. The Java Language Specification (JLS §3.8) explicitly allows the dollar sign as a starting character, though it is conventionally reserved for mechanically generated names.

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.