Skip to content
Sharp

Core Java · interview question

How would you explain a good practice when naming a method that calculates the total price in an e-commerce application in an interview?

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

Correct answer

A. CalculateTotalPrice

Why

Descriptive and clear method names like calculateTotalPrice help maintain readability and indicate the method's purpose at a glance.

Test yourself on Core Java

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

Start free test
All Core Java questions →