implement SportsCar.java
This commit is contained in:
@@ -24,7 +24,22 @@ public class SportsCar extends GasCar {
|
|||||||
this.zeroToHundred = zeroToHundred;
|
this.zeroToHundred = zeroToHundred;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Override showDetails()
|
|
||||||
// Call super.showDetails()
|
@Override
|
||||||
// Print acceleration time
|
public void showDetails() {
|
||||||
|
super.showDetails();
|
||||||
|
System.out.println(" | accelaration time: " + 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