`
mhbjava
  • 浏览: 95855 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

java几个新知识点

阅读更多
interface也是Object类的子类
证明如下
……
public static void xxx(Runnable run)
{
       System.out.print(run.toString() + run.hashCode()); 
}
……
编译可以通过,而Runnable接口本身只有run方法,所以interface的父类确实是ObjectRunnable继承了ObjecttoStringhashCode方法。
 
接口可以多重继承
证明如下
……
public class MyInterface extends Runnable,Collection,FileFilter
{
       ……
}
编译可以通过。 


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics