Skip to content
Sharp

Core Java · interview question

What should you be cautious about when using int to store product quantities?

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

Correct answer

D. Int has a maximum value limit

Why

The int type has a maximum value limit (2,147,483,647), which might be exceeded in some cases, potentially leading to overflow errors.

Test yourself on Core Java

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

Start free test
All Core Java questions →