public interface Boats { public void launch(); }
public interface MotorizedBoat extends Boats{ public void start(); }
public interface Car { public void start(); }
public class BasicCar implements Car{ @Override public void start() { Engine e1 = new Engine(){ public String start(){ return ("Engine is :" + start()); } }; } private static class Engine { public String start(){ return "Starting ...."; } } }
public class AmphibiousCar extends BasicCar implements MotorizedBoat , java.io.Serializable{ @Override public void launch() { System.out.println("要行駛了...."); } }