Advertisement

Udemy WW Udemy WW

Wednesday 30 November 2011

Is intreface inherits Object class, how can we able to access the methods of object class through a interface type reference

No Interface does not inherits Object class,but it provide accessibility to all methods of Object class. 
The members of an interface are:

  • Those members declared in the interface.
  • Those members inherited from direct superinterfaces.
  • If an interface has no direct superinterfaces, then the interface implicitly declares a public abstract member method corresponding to each public instance method declared in Object, . 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.
Now it is clear that all superinterface have abstract member method corresponding to each public instance method declared in Object .

2 comments:

Advertisement

Udemy WW