Interface

21. Program

//Find what it gives Compiletion Error / Compiletion Successfully / Output ?

interface A { void test1(); } interface B { void test2(); } abstract class C { public void test4() { System.out.println("From test4"); } abstract void test3(); } class D extends C implements A, B { public void test1() { System.out.println("From test1"); } public void test2() { System.out.println("From test2"); } void test3() { System.out.println("From test3"); } public static void main(String[] args) { D d1 = new D(); d1.test1(); d1.test2(); d1.test3(); d1.test4(); System.out.println("Done"); } }

22. Program

//Find what it gives Compiletion Error / Compiletion Successfully / Output ?

interface E { void test1(); } class F { public void test1() { System.out.println("from test1"); } } class G extends F implements E { public static void main(String[] args) { G g1 = new G(); g1.test1(); System.out.println("Done"); } }

23. Program

//Find what it gives Compiletion Error / Compiletion Successfully / Output ?

abstract class X { abstract void main(); } class Y extends X { void main(int i) //method Overloadig { } }

Page....