Skip to content
Sharp

Core Java · interview question

What should you consider when naming a method that checks if a cart is eligible for a discount?

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

Correct answer

C. Use a descriptive name like isEligibleForDiscount

Why

A descriptive name like isEligibleForDiscount clearly communicates the method's purpose, making the code easier to understand and maintain. This is especially important in collaborative or large-scale projects.

Test yourself on Core Java

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

Start free test
All Core Java questions →