Skip to content
Sharp

Core Java · interview question

How should you structure an if-else statement to verify both product availability and minimum order quantity?

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

Correct answer

A. If (available && minOrder > 0) {}

Why

The condition 'available && minOrder > 0' ensures the product is available and the minimum order quantity is greater than zero, both necessary for processing an order.

Test yourself on Core Java

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

Start free test
All Core Java questions →