1Z0-811 Primitives, Strings and Operators Practice Question
What is the result of: System.out.println(10 + 20 + "30");
⚠ Common exam trap
Many exam-takers assume all '+' operators in a mixed expression perform string concatenation, forgetting that Java evaluates left to right and that integer addition takes precedence until a string operand is encountered.
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
✓
3030
In Java, the '+' operator is left-associative. The expression `10 + 20 + "30"` is evaluated as `(10 + 20) + "30"`, which first performs integer addition to get `30`, then concatenates that integer with the string `"30"`, resulting in the string `"3030"`. The `System.out.println` method then prints the string `3030`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
102030
Why it's wrong here
Incorrect.
- ✓
3030
Why this is correct
Correct because addition then concatenation.
- ✗
30
Why it's wrong here
Incorrect.
- ✗
Compilation fails
Why it's wrong here
Incorrect.
Go deeper
Related to this question
About these practice questions
This 1Z0-811 question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.