Skip to content
Sharp

Core Java · interview question

Why might 'long' be a good choice for tracking the total number of orders in a large e-commerce system?

Multiple choiceHardchapter-1-curatedpremiumcore-javavariables-and-data-types
Choose one answer
Answer and explanation

Correct answer

A. It can store larger values than int.

Why

The 'long' type can represent a much larger range of values than 'int', making it suitable for counting large quantities such as total orders.

Test yourself on Core Java

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

Start free test
All Core Java questions →