Skip to main content

about interface and class

No replies
vishalmestri
Offline
Joined: 2006-04-10

--------------------------------
> myinterface.java
> ------------
> interface myinterface
> {
> class A
> {
> A()
> {System.out.println("A()
> of interface");}
> }
> }
> --------------------------------
> A.java
> ---------
> class A implements
> myinterface
> {
> A(){System.out.println("A()
> of A.java");}
>
> public static void main
> (String args[])
> {
> A a=new A();
> //this calls A() of interface
> //myinterface.java
> }
> }
>
> //how come the output of
> this code is like this
>