abstract class Demo{ abstract void method1(); abstract void method2(); … } |
interface Demo{ void method1(); void method2(); … } |
abstract class Door{ abstract void open(); abstract void close(); } |
interface Door{ void open(); void close(); } |
abstract class Door{ abstract void open(); abstract void close(); abstract void alarm(); } |
interface Door{ void open(); void close(); void alarm(); } |
class AlarmDoor extends Door{ void open(){…} void close(){…} void alarm(){…} } |
class AlarmDoor implements Door{ void open(){…} void close(){…} void alarm(){…} } |
abstract class Door{ abstract void open(); abstract void close(); } interface Alarm{ void alarm(); } class Alarm Door extends Door implements Alarm{ void open(){…} void close(){…} void alarm(){…} } |
欢迎光临 学考易 (http://xuekao1.com/) | Powered by Discuz! X3 |