Skip to content
ExamSpine

Answer it

Overriding and overloading in a delivery app

4 marksYou mark it yourself against the marking points

A delivery app has a superclass Parcel with a method that works out the delivery cost from the parcel's weight. A subclass FragileParcel needs a different cost, because fragile parcels are packed by hand. The programmer also wants a second way to work out the cost of any parcel, when the customer gives a discount code.

Distinguish between overriding and overloading, using this app to give an example of each. [4]

Report a problem with this page