interface 本身就是abstract的,只不过没有明确的规定出来,说一定要把abstract这个关键字写上。
所以abstract interface 就是interface,两者根本没有区别。
在《java in a nutshell》里,
“All methods of an interface are implicitly abstract, even if the abstract modifier is omitted. ”
在《thinking in java》里,
“ the abstract keyword, which allows you to create one or more methods in a class that have no definitions
—you provide part of the interface without providing a corresponding implementation, which is created by inheritors.
The interface keyword produces a completely abstract class, one that provides no implementation at all.”
所以结论就是 abstract interface 就是interface,两者根本没有区别。
本文转帖自:http://www.blogjava.net/gembin/archive/2008/03/21/187746.html
本文解释了Java中interface本身的抽象特性,指出所有的接口方法默认都是抽象的,即使没有明确使用abstract关键字。通过引用《javainanutshell》和《thinkinginjava》,强调interface与abstractinterface在Java中是等价的。
902

被折叠的 条评论
为什么被折叠?



