接口:
    1,所有实现了该接口的类看起来都像这样。因此,任何使用了该特定接口的类只需要知道该接口的方法即可。
    2,接口是一种可以向上转型为多种基类的类型,可以实现类似多重继承的特性
    3,接口的最小访问权限仅可以定义为默认权限

    image.png

    1. interface Instrument{
    2. void play();
    3. }
    4. //No interface expected here
    5. //abstract class Wind extends Instrument{}
    6. /*abstract class Wind implements Instrument{
    7. }*/
    8. interface Wind{
    9. void adjust();
    10. }
    11. interface Foo extends Instrument,Wind{}
    12. public class InstrumentApp {
    13. public static void main(String[] args) {
    14. }
    15. }