Class SportsCar completed.
This commit is contained in:
@@ -24,7 +24,20 @@ public class SportsCar extends GasCar {
|
||||
this.zeroToHundred = zeroToHundred;
|
||||
}
|
||||
|
||||
// TODO: Override showDetails()
|
||||
// Call super.showDetails()
|
||||
// Print acceleration time
|
||||
@Override
|
||||
public void showDetails() {
|
||||
super.showDetails();
|
||||
System.out.println(zeroToHundred);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsService(Vehicle v) {
|
||||
double mileage = v.getMileage();
|
||||
return (mileage > 5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performService() {
|
||||
System.out.println("High-performance brake system checked");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user