Skip to content
Sharp

Core Java · interview question

How can you check if a variable 'points' is exactly 100?

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

Correct answer

C. If (points == 100) {}

Why

The equality operator '==' is used to check if 'points' is exactly equal to 100. Assigning a value would use a single '='.

Test yourself on Core Java

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

Start free test
All Core Java questions →