您的位置:首页 > 编程语言 > Java开发

Java 语法: abstract interface和interface的区别

2010-03-31 10:56 316 查看

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: