Skip to content
Sharp

Core Java · interview question

Why is it beneficial to avoid duplicating logic in methods when developing an e-commerce application?

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

Correct answer

A. It leads to inconsistencies and errors.

Why

Duplicating logic can lead to inconsistencies and errors because changes need to be applied in multiple places, increasing the risk of mistakes.

Test yourself on Core Java

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

Start free test
All Core Java questions →