Abstract Keyword

1. Program

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

abstract class A { void test1() { System.out.println("method"); } abstract void test2(); }

2. Program

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

class C { abstract void method1(); abstract void method2(); abstract void method3(); abstract void method4(); abstract void method5(); }

3. Program

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

abstract class D { void test1(); // abstract method void test2(int i, int j) { } void test3(); void test4(int i, int j, float k) { } }

4. Program

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

abstract class E { abstract void test1() { } void test2() { } }

5. Program

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

abstract class F { abstract void test1(); void test2() { System.out.println("from test2"); } } class G extends F { void test1() { System.out.println("From test1"); } public static void main(String[] args) { // F f1 = new F(); G g1 = new G(); // f1.test1(); // f1.test2(); g1.test1(); g1.test2(); System.out.println("Done"); } }

Page....