15.1) Write a program to convert String value into Integer Wrapper class objects. PROGRAM: class util { public static void main(String args[]) { String s ; s="1101"; int i; i=Integer.parseInt (s,2); System.out.println(i); } } OUTPUT:
15.2) write a program to convert integer object value into primitive data-type byte,short, and double value. PROGRAM: Class help { public static void main(String args[]) { Integer i =new Integer(10); byte b = i.byteValue(); System.out.println("Byte ="+b);
double d = i.doubleValue(); System.out.println("Double ="+d);
short s = i.shortValue(); System.out.println("Short = "+s); } }
OUTPUT: