Skip to content
Sharp

Core Java · interview question

What happens if you use the division operator between two int variables in Java?

Multiple choiceMediumchapter-1-curatedpremiumcore-javanumeric-types-and-money-basics
Choose one answer
Answer and explanation

Correct answer

A. It performs integer division.

Why

Using the division operator between two int variables results in integer division, which discards any fractional part and returns only the integer quotient.

Test yourself on Core Java

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

Start free test
All Core Java questions →