Java基本数据类型转换一

public class TestConvert {

/**容量小的类型自动转化为容量大的类型数据类型按容量大小排列
* byte,short,char -> int ->long->float->double
* @param args前三种不相互转换,计算时先转回int
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int i1 = 123;
int i2 = 456;
double d1 =(i1+i2)*1.2;
float f1 = (float)((i1+i2)*1.2);
byte b1 = 67;
byte b2 = 89;
byte b3 = (byte)(b1+b2);

double d2 = 1e200;
float f2 = (float)d2;//小数点不可以砍掉,整数可以砍掉

float f3 = 1.23f;
long l1= 123;
long l2 = 3000000000000l;
float f = l1 + l2 + f3;
long l = (long)f;

System.out.println(d1);
System.out.println(f1);
System.out.println(b3);
System.out.println(f2);

}

}