HeshamTB
eb94de2754
- Abstract class CivilVehicle that implements Breakable and contains all common fields of vehicles. Now for example, Sedan <- CivilVehicle <- Vehicle ^ Breakable The breakable methods are mostly implemented in CivilVehicle Except getTimeToFix() which is defined in subclasses of CivilVehicle. - Breakable interface: The method collide() now returns instance of Accident instead of void Signed-off-by: HeshamTB <hishaminv@gmail.com>
15 lines
251 B
Java
15 lines
251 B
Java
import java.util.Date;
|
|
|
|
public class Sedan extends CivilVehicle {
|
|
|
|
private final int TIME_TO_FIX = 15; //in minutes
|
|
|
|
public Sedan(double vehicleSize){
|
|
super(vehicleSize);
|
|
}
|
|
|
|
public int getTimeToFix(){ return TIME_TO_FIX; }
|
|
|
|
|
|
}
|