public class demo06 {标签:int,money,System,long,demo6,year,out From: https://www.cnblogs.com/taodream/p/17867354.html
public static void main(String[] args) {
int money=10_0000_0000;
System.out.println(money);
int year=20;
int total=money*year;//-1474836480 计算的时候溢出了
System.out.println(total);//默认的是int,转换前就已经存在问题了?
long total2=money*((long)year);//先把一个数转换为long
System.out.println(total2);//输出结果200000000
}
}