public class Example2_2{
public static void main(String args[]){
byte a=120;
short b=130;
int c=2200;
long d=8000;
float f;
double g=0.1234567812345678;
a=(byte)b;
c=(int)d;
f=(float)g;
System.out.println("a="+a);
System.out.println("c="+c);
System.out.println("f="+f);
System.out.println("g="+g);
}
}
public static void main(String args[]){
byte a=120;
short b=130;
int c=2200;
long d=8000;
float f;
double g=0.1234567812345678;
a=(byte)b;
c=(int)d;
f=(float)g;
System.out.println("a="+a);
System.out.println("c="+c);
System.out.println("f="+f);
System.out.println("g="+g);
}
}
![](https://img-my.csdn.net/uploads/201303/18/1363608501_8704.jpg)