Object & interface


For an interface, the value of the super_class item must always be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Class_info structure representing the class Object.


=========================

If an interface has no direct superinterfaces, then the interface implicitly declares a public abstract member method m with signature s, return type r, and throws clause t corresponding to each public instance method m with signature s, return type r, and throws clause t declared in Object, unless a method with the same signature, same return type, and a compatible throws clause is explicitly declared by the interface. It is a compile-time error if the interface explicitly declares such a method m in the case where m is declared to be final in Object. 

如果一个接口没有直接的父接口,那么,这个接口就隐含的声明了这样的一些成员方法m,这个方法是public abstract的,签名是s,返回类型是r,抛出t类型异常,与Object类中声明的public的,签名是s,返回类型是r,抛出t类型异常的方法相对应,除非,接口中明确定义了这样的方法。
如果接口明确的声明了这样的方法m,m在Object类中是final的,这将会产生编译时error。

posted @ 2011-12-21 15:34  0707  阅读(201)  评论(0编辑  收藏  举报