Opening Hours :7AM to 9PM
interface InterfaceName { public static final variable1; public static final variable2; .. .. abstract method1(); abstract method2(); .. .. }
interface Demo { int x=10; -> the signature is public static final int x=10; void show(); -> abstract void show(); void disp();-> abstract void disp(); }
interface InterfaceName1 { returntype methodname1(); .. .. } interface InterfaceName2 { returntype methodname2(); .. .. } .. .. class classname implements InterfaceName1,InterfaceName2,... { accessmodifiers returntype methodname1() { Statement 1; Statement 2; .. .. } accessmodifiers returntype methodname2() { Statement 1; Statement 2; .. .. } .. .. }
interface Addition { void add(); } interface Substraction { void sub(); } class Demo implements Addition,Substraction { int x,y,z; public void add() { x=100; y=200; z=x+y; System.out.println("addition is "+z); } public void sub() { x=100; y=200; z=x-y; System.out.println("substraction is "+z); } void mul() { x=100; y=200; z=x*y; System.out.println("multiplication is "+z); } } public class Main { public static void main(String args[]) { Demo d=new Demo(); d.add(); d.sub(); d.mul(); } }