R4R Java SourceCode Interface Example

Interface Example

In this example we are creating an interface . We are giving the signature of methods and the body of these method will given into implemented method.

SOURCE CODE

interface  InterfaceExp{
            abstract void show();
             void show1();
             void show2();
             int a=0;           
            }
class InterfaceDemo implements InterfaceExp{       
   public  void show(){}
   public void show1(){}
   public void show2(){}
}
class Interface{
public static void main(String a[])
{
InterfaceDemo demo=new InterfaceDemo();
             demo.show();
}
}

Download Source File