Specifications
Sun Services
Java™ Programming Language
Module 7, slide 33 of 44
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
The Solution
Likewise, the RiverBarge class must create an
implementation:
1 public class RiverBarge extends Vehicle {
2 public RiverBarge(double maxLoad) {...}
3 public double calcFuelEfficiency() {
4 /* calculate the fuel efficiency of a river barge */
5 }
6 public double calcTripDistance() {
7 /* calculate the distance of this trip along the river-ways */
8 }
9}










