Traffic police implements CanFixAcc
SetVehicleSize is private
This commit is contained in:
parent
2c6721c89a
commit
c5db5dcac0
@ -1,4 +1,4 @@
|
|||||||
public class TrafficPoliceCar extends Vehicle implements CanBeGovtCar {
|
public class TrafficPoliceCar extends Vehicle implements CanBeGovtCar, CanFixAccident {
|
||||||
|
|
||||||
private final double ADDED_EFFICIENCY = 0.05; // 5%
|
private final double ADDED_EFFICIENCY = 0.05; // 5%
|
||||||
private int govtID;
|
private int govtID;
|
||||||
|
@ -9,7 +9,7 @@ public abstract class Vehicle {
|
|||||||
return vehicleSize;
|
return vehicleSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVehicleSize(double vehicleSize) {
|
private void setVehicleSize(double vehicleSize) {
|
||||||
if (vehicleSize <= 0) throw new IllegalArgumentException("Vehicle can not be negative in length!");
|
if (vehicleSize <= 0) throw new IllegalArgumentException("Vehicle can not be negative in length!");
|
||||||
else this.vehicleSize = vehicleSize;
|
else this.vehicleSize = vehicleSize;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user