Static Final Keyword

1. Program

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

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

2. Program

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

class B { static final int i = 10; public static void main(String args[]) { System.out.println(i); i = 10; System.out.println(i); } }

3. Program

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

class C { final static int i = 10; void test() { i = 10; } }

4. Program

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

class D { static final int i; }

5. Program

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

class E { static final int i; static { i = 10; } }

6. Program

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

class G { static final int i; static { i = 10; } static { i = 10; } }

7. Program

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

class H { final int i; H() { i = 10; } H(double j) { i = 20; } public static void main(String args[]) { H h1 = new H(); H h2 = new H(90.90); System.out.println(h1.i); System.out.println(h2.i); } }

Page....