- interface AbsDemo
- <span style="color: rgb(177, 8, 0); font-family: Monaco, Consolas, 'Lucida Console', 'Courier New', serif; font-size: 12px; line-height: 21.600000381469727px; background-color: rgb(255, 255, 255); ">//接口可以认为是一种特殊的抽象类,从而弥补了java单继承的短板,用了多实现</span>
- {
- abstract void show();
- }
- class Demo implements
- AbsDemo
- <span style="color: rgb(177, 8, 0); font-family: Monaco, Consolas, 'Lucida Console', 'Courier New', serif; font-size: 12px; line-height: 21.600000381469727px; background-color: rgb(255, 255, 255); ">//Demo实现了接口,要对里面的抽象方法进行覆写;</span>
- {
- public void show(){}
复制代码
|