26. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class M27 { static void test(Integer obj) { System.out.println("done"); } public static void main(String[] args) { test(10); //test (new Integer(10)); done by compiler } }
27. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class M28 { static void test(int i) { System.out.println("done"); } public static void main(String[] args) { Integer obj = new Integer(10); test(obj); // test(obj.intValue()); DOne by Compiler } }
28. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class M29 { static void test(int j) { System.out.println("done"); } public static void main(String[] args) { Integer obj = new Integer(90); test(obj.intValue()); } }
29. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class M30 { public static void main(String[] args) { Double d1 = new Double(30); double d2 = 90; test(d1); test(new Double(d2)); } static void test(Double obj) { System.out.println("done"); } }
30. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class M31 { public static void main(String[] args) { test('a'); char c1 = 't'; test(c1); Character c2 = 'p'; test(c2); } static void test(Character obj) { System.out.println("done"); } }