Skip to content
Sharp

Core Java · interview question

What type of value does a method that checks inventory availability in a store likely return?

Multiple choiceEasychapter-1-curatedpremiumcore-javamethods
Choose one answer
Answer and explanation

Correct answer

D. Boolean

Why

A method checking inventory availability is likely to return a boolean value, indicating whether an item is in stock (true) or not (false). This allows the application to respond appropriately based on the availability status.

Test yourself on Core Java

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

Start free test
All Core Java questions →