Java中的接口与抽象类

抽象类很简单,就是多了个abstract关键字,可以有(也可以没有)只声明不定义的方法。不能实例化该类。

接口比较特殊:

无论你加不加public,接口中声明的方法都是public的,还有无论你加不加static final,接口中的成员都由这两个关键字修饰。

Fields defined in interfaces cannot be "blank finals", but they can be initialized with non-constant expressions.

原文地址:https://www.cnblogs.com/hustxujinkang/p/4461323.html