Traffic police implements CanFixAcc

SetVehicleSize is private
This commit is contained in:
HeshamTB 2020-10-20 12:55:16 +03:00
parent 2c6721c89a
commit c5db5dcac0
Signed by: Hesham
GPG Key ID: 74876157D199B09E
2 changed files with 2 additions and 2 deletions

View File

@ -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 int govtID;

View File

@ -9,7 +9,7 @@ public abstract class Vehicle {
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!");
else this.vehicleSize = vehicleSize;
}