Skip to content
Sharp

Core Java · interview question

What is branching doing in a rule like if (subtotal >= 100.0) shippingFee = 0.0;?

Multiple choiceMediumchapter-1-curatedpremiumcore-javaconditions-and-branching
Choose one answer
Answer and explanation

Correct answer

B. Turning a business rule into two possible code paths

Why

An if statement expresses a business decision in code. In a checkout flow, branching maps rules like free shipping or premium discounts into explicit program behavior.

Test yourself on Core Java

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

Start free test
All Core Java questions →