Code:
public class Test
{
public static void main( String args[] )
{
byte b1 = 100;
short b2 = 200;
int b3 = 300;
long b4 = 400l;
float b5 = 12.2345f;
double b6 = 56.56d;
char b7 = 'a';
boolean b8 = true;
// Primitive data represents in the form of Wrapper Class
Byte c1 = Byte.valueOf(b1);
Short c2 = Short.valueOf(b2);
Integer c3 = Integer.valueOf(b3);
Long c4 = Long.valueOf(b4);
Float c5 = Float.valueOf(b5);
Double c6 = Double.valueOf(b6);
Character c7 = Character.valueOf(b7);
Boolean c8 = Boolean.valueOf(b8);
// Wrapper class to Primitive Data
byte d1 = c1.byteValue();
short d2 = c2.shortValue();
int d3 = c3.intValue();
long d4 = c4.longValue();
float d5 = c5.floatValue();
double d6 = c6.doubleValue();
char d7 = c7.charValue();
boolean d8 = c8.booleanValue();
System.out.println(b1+"..."+c1+"...."+d1);
System.out.println(b2+"..."+c2+"...."+d2);
System.out.println(b3+"..."+c3+"...."+d3);
System.out.println(b4+"..."+c4+"...."+d4);
System.out.println(b5+"..."+c5+"...."+d5);
System.out.println(b6+"..."+c6+"...."+d6);
System.out.println(b7+"..."+c7+"...."+d7);
System.out.println(b8+"..."+c8+"...."+d8);
}
}
Output:
public class Test
{
public static void main( String args[] )
{
byte b1 = 100;
short b2 = 200;
int b3 = 300;
long b4 = 400l;
float b5 = 12.2345f;
double b6 = 56.56d;
char b7 = 'a';
boolean b8 = true;
// Primitive data represents in the form of Wrapper Class
Byte c1 = Byte.valueOf(b1);
Short c2 = Short.valueOf(b2);
Integer c3 = Integer.valueOf(b3);
Long c4 = Long.valueOf(b4);
Float c5 = Float.valueOf(b5);
Double c6 = Double.valueOf(b6);
Character c7 = Character.valueOf(b7);
Boolean c8 = Boolean.valueOf(b8);
// Wrapper class to Primitive Data
byte d1 = c1.byteValue();
short d2 = c2.shortValue();
int d3 = c3.intValue();
long d4 = c4.longValue();
float d5 = c5.floatValue();
double d6 = c6.doubleValue();
char d7 = c7.charValue();
boolean d8 = c8.booleanValue();
System.out.println(b1+"..."+c1+"...."+d1);
System.out.println(b2+"..."+c2+"...."+d2);
System.out.println(b3+"..."+c3+"...."+d3);
System.out.println(b4+"..."+c4+"...."+d4);
System.out.println(b5+"..."+c5+"...."+d5);
System.out.println(b6+"..."+c6+"...."+d6);
System.out.println(b7+"..."+c7+"...."+d7);
System.out.println(b8+"..."+c8+"...."+d8);
}
}
Output: