Skip to content
Sharp

Core Java · interview question

When should a custom exception be created in an e-commerce application?

Multiple choiceHardchapter-6-curatedpremiumcore-javathrow-throws-and-propagation
Choose one answer
Answer and explanation

Correct answer

C. For specific business rule violations

Why

A custom exception should be created for specific business rule violations, such as insufficient funds or invalid order states. This makes error handling more meaningful and domain-specific.

Test yourself on Core Java

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

Start free test
All Core Java questions →