All Mix

1. Program

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

class F1 { { System.out.println("F1-IIB1"); } F1(int i) { this(); System.out.println("F1(int)"); } F1() { System.out.println("F1()"); } public static void main(String[] args) { F1 f1 = new F1(); System.out.println("------"); F1 f2 = new F1(10); System.out.println("------"); } }

2. Program

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

class G { { System.out.println("IIB"); } G() { this(90); System.out.println("G()"); } G(int i) { System.out.println("G(int)"); } public static void main(String[] args) { G g1 = new G(); System.out.println("------"); G g2 = new G(20); System.out.println("------"); } }

3. Program

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

class H { H(int i) { System.out.println("H(int)"); } { System.out.println("IIB-1"); } H() { this(10); System.out.println("H()"); } { System.out.println("IIB-2"); } public static void main(String[] args) { H h1 = new H(); System.out.println("------"); H h2 = new H(20); System.out.println("------"); } }

4. Program

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

class I { I() { System.out.println("I()"); } { System.out.println("IIB-1"); } static { System.out.println("SIB"); } public static void main(String[] args) { I i1 = new I(); System.out.println("------"); I i2 = new I(); System.out.println("------"); I i3 = new I(); System.out.println("------"); } }

5. Program

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

class J { J() { System.out.println("J()"); } { System.out.println("J_IIB"); } J(int i) { this(); System.out.println("J(int)"); } static { System.out.println("J-SIB"); } public static void main(String[] args) { J j1 = new J(); System.out.println("----"); J j2 = new J(20); System.out.println("-----"); } }

Page....