Courseiva
Primitives, Strings and OperatorshardMultiple ChoiceObjective-mapped

1Z0-811 Primitives, Strings and Operators Practice Question

What is the value of z after executing: int x = 3; int y = 2; int z = x++ * --y;

⚠ Common exam trap

Oracle often tests the difference between pre- and post-increment/decrement operators, and the trap here is that candidates mistakenly apply both operators to the original values or forget that post-increment returns the value before the increment.

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

3

The expression `x++ * --y` uses post-increment on `x` and pre-decrement on `y`. Post-increment returns the original value of `x` (3) before incrementing it to 4. Pre-decrement decrements `y` from 2 to 1, then returns the new value (1). The multiplication is 3 * 1 = 3, which is assigned to `z`. So the correct answer is 3.

Answer analysis

Option-by-option breakdown

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

  • 3

    Why this is correct

    x++ uses 3, --y yields 1, product = 3.

  • 6

    Why it's wrong here

    Incorrect order.

  • 4

    Why it's wrong here

    Not correct.

  • 2

    Why it's wrong here

    Miscalculation.

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.