Courseiva
Primitives, Strings and OperatorshardMultiple ChoiceObjective-mapped

1Z0-811 Primitives, Strings and Operators Practice Question

A developer writes: char c = 'A'; int i = c + 1; System.out.println(i); What is the output?

⚠ Common exam trap

Oracle often tests the misconception that `char` and `int` cannot be added, or that the result remains a `char` and would print as a character, causing candidates to choose 'B' instead of the numeric value.

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

66

In Java, when a `char` is involved in arithmetic with an `int`, the `char` is promoted to its Unicode/ASCII numeric value. 'A' has the ASCII value 65, so `c + 1` becomes 66. The result is an `int`, and `System.out.println(i)` prints the integer 66.

Answer analysis

Option-by-option breakdown

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

  • 66

    Why this is correct

    'A' is 65, plus 1 equals 66.

  • B

    Why it's wrong here

    Output is int, not char.

  • Compilation error: cannot add char and int.

    Why it's wrong here

    Implicit promotion allowed.

  • 'A1'

    Why it's wrong here

    String concatenation not used.

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 →

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.