Skip to content
Sharp

Core Java · interview question

In Java, which operator would you use to check if a product's stock is exactly 10?

Multiple choiceEasychapter-1-curatedpremiumcore-javaoperators-and-expressions
Choose one answer
Answer and explanation

Correct answer

D. ==

Why

In Java, the '==' operator is used to compare primitive types for equality. '=' is used for assignment, not comparison.

Test yourself on Core Java

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

Start free test
All Core Java questions →