1Z0-811 Java Basics and Syntax Practice Question
Exhibit
Refer to the exhibit. int x = 10; double y = 5.5; int result = x + y;
What is the result of compiling and running this code?
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
✓
Compilation error
The code attempts to assign a double value (e.g., from an expression like `int + double`) to an int variable without casting. This results in a compilation error: 'possible lossy conversion from double to int'. Therefore, option C (compilation error) is correct. Options A, B, D, and E are incorrect because they assume the code compiles and runs, but it does not.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
15
Why it's wrong here
Would be the result if a cast to int were used, but no cast here.
- ✗
10.5
Why it's wrong here
Incorrect arithmetic.
- ✓
Compilation error
Why this is correct
Incompatible types: double cannot be converted to int implicitly.
- ✗
15.5
Why it's wrong here
Would be the result if result were a double, but assignment fails compilation.
- ✗
16
Why it's wrong here
Incorrect arithmetic.
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.