Skip to content
Sharp

Core Java · interview question

In an e-commerce application, why is it useful to have a method like boolean isEligibleForFreeShipping(double cartTotal)?

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

Correct answer

C. To determine if the cart qualifies for free shipping.

Why

This method evaluates whether the total price of items in the cart meets a threshold for free shipping, allowing for clear and reusable logic to be applied across the application.

Test yourself on Core Java

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

Start free test
All Core Java questions →