1Z0-811 Java Basics and Syntax Practice Question
Which THREE are valid Java identifiers?
⚠ Common exam trap
The 1Z0-811 exam often tests the rule that identifiers cannot start with a digit and cannot contain hyphens, tricking candidates who might think underscores or dollar signs are invalid or that hyphens are acceptable.
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
✓
my_value
(my_value) is a valid Java identifier because it starts with a letter (m) and contains only letters, digits, and underscores. Java identifiers must begin with a letter, underscore, or dollar sign, and subsequent characters can include letters, digits, underscores, or dollar signs.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
2ndValue
Why it's wrong here
Cannot start with digit.
- ✓
my_value
Why this is correct
Valid underscore in name.
- ✓
$dollar
Why this is correct
Valid dollar sign start.
- ✗
my-var
Why it's wrong here
Hyphen is not allowed.
- ✓
_myVar
Why this is correct
Valid underscore start.
Go deeper
Related to this question
About these practice questions
One of 481 original 1Z0-811 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.