1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
package 数据类型和运算符;
public class TestTypeConvertError { public static void main(String[] args) { int a = 1000000000; int b = 20; int ans1 = a*b; System.out.println(ans1); long ans2 = a*b; System.out.println(ans2); long ans3 = a*((long)b); System.out.print(ans3); } }
|