Skip to content
Sharp

Core Java · interview question

In an e-commerce application, which condition checks if a product is eligible for a discount when its price is above 100?

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

Correct answer

A. If (price > 100) {}

Why

The correct condition to check if a price is above 100 is 'price > 100'. This evaluates to true for any price greater than 100.

Test yourself on Core Java

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

Start free test
All Core Java questions →