Wrapper Classes

13. Program

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

class M13 { public static void main(String[] args) { String s1 = "908G; Double d1 = Double.valueOf(s1); System.out.println("done"); } }

14. Program

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

class M14 { public static void main(String[] args) { String s1 = "s"; char c1 = 'd'; Character c2 = Character.valueOf(s1); Character c3 = Character.valueOf(c1); System.out.println("done"); } }

15. Program

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

class M15 { public static void main(String[] args) { int i = 10; String s1 = Integer.toString(i); double j = 34.09; String s2 = Double.toString(j); boolean k = true; String s3 = Boolean.toString(k); char c1 = 'f'; String s4 = Character.toString(c1); System.out.println("done"); } }

16. Program

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

class M16 { public static void main(String[] args) { String s1 = "45"; byte b1 = Byte.parseByte(s1); int i = Integer.parseInt(s1); double d1 = Double.parseDouble(s1); long d2 = Long.parseLong(s1); System.out.println(b1); System.out.println(i); System.out.println(d1); System.out.println(d2); } }

Page....