Object Class

9. Program

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

class J { int x; public String toString() { String s1 = super.toString(); String s2 = "x = " + x; return s1 + ", " + s2; } } class Manager9 { public static void main (String[] args) { J j1 = new J(); j1.x = 200; System.out.println(j1); } }

10. Program

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

class K { int k = 10; } class Manager11 { public static void main (String[] args) { K k1 = new K(); K k2 = new K(); System.out.println(k1==k2); } }

11. Program

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

class L { int i ; } class Manager12 { public static void main (String[] args) { L l1 = new L(); l1.i = 10; L l2 = new L(); l2.i = 20; System.out.println(l1==l2); } }

12. Program

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

class M { int i ; M(int i) { this.i = i; } } class Manager13 { public static void main (String[] args) { M m1 = new M(90); M m2 = new M(90); System.out.println(m1==m2); } }

Page....