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