数据类型之间的运算
作者:互联网
package operator;
import static java.lang.Character.getType;
public class Demo02 {
public static void main(String[] args) {
long a = 123123123123123L;
int b = 123;
short c = 10;
byte d = 8;
double pi = 3.14;
System.out.println(pi+a+b+c+d);
System.out.println(a+b+c+d);//long
System.out.println(b+c+d);//Int
System.out.println (c+d);//Int 任意非long整数运算,结果总是Int型
}
}
标签:运算,Int,数据类型,System,long,static,之间,println,out 来源: https://www.cnblogs.com/whgjwr/p/16349580.html