public class Example2_2{
public static void main(String arg[]){
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://www.cnblogs.com/wangchunmeix/archive/2013/03/15/2961963.html