Courseiva
Primitives, Strings and OperatorshardMultiple ChoiceObjective-mapped

1Z0-811 Primitives, Strings and Operators Practice Question

Given: byte b = 10; b = b + 1; What is the result?

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

In Java, arithmetic operations on byte promote the result to int. Assigning an int to a byte without a cast causes a compilation error.

Answer analysis

Option-by-option breakdown

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

  • Runtime exception

    Why it's wrong here

    Incorrect: the error is caught at compile time.

  • b becomes 10

    Why it's wrong here

    Incorrect: the compilation error prevents execution.

  • Compilation error

    Why this is correct

    Correct: b+1 is int, cannot assign to byte without explicit cast.

  • b becomes 11

    Why it's wrong here

    Incorrect: the code does not compile.

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 →

How Courseiva writes practice questions · Editorial policy

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.