Skip to content
Sharp

Core Java · interview question

Why is it useful to trace one checkout example by hand before trusting the program output?

Multiple choiceMediumchapter-1-curatedpremiumcore-javacode-reading-and-debugging
Choose one answer
Answer and explanation

Correct answer

A. It gives you expected intermediate values so you can isolate where the logic went wrong

Why

If you already know the expected subtotal, discount, and final total for one example, you can compare the program's intermediate values and locate the bug much faster than staring only at the final answer.

Test yourself on Core Java

A free test with instant, explained results. No account needed.

Start free test
All Core Java questions →