Inner Classes

5. Program

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

class E { static class E { int i ; void test() { } static int j ; static void test1() { } } }

6. Program

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

class G { class H { } static class I { } public static void main(String[] args) { H h1 = null; I i1 = null; //h1 = new H(); i1 = new I(); System.out.println("done"); } }

7. Program

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

class H { class I { } static class J { } } class Manager { public static void main(String[] args) { H.I obj1 = null; H.I obj2 = null; obj1 = new H().new I(); H h1 = new H(); obj1 = h1.new I(); obj2 = new H.J(); System.out.println("done"); } }

8. Program

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

class I { public static void main(String[] args) { class A { int i = 10; } A a1 = new A(); System.out.println(a1.i); a1.i = 20; System.out.println(a1.i); } }

Page....