Type Conversion

Conversion

class conver
{
public static void main(String args[])
{
byte b;
int i=257;
double d=323.143;
b=(byte)i;
System.out.println("convert from int="+i+" to byte "+b);
i=(int)d;
System.out.println("convert from double="+d+" to int="+i);
b=(byte)d;
System.out.println("convert from double="+d+" to byte= "+b);
}
}