diff --git a/src/main/java/com/github/hcsp/datatype/IntegerOverflow.java b/src/main/java/com/github/hcsp/datatype/IntegerOverflow.java index e476132..c1cd9bd 100644 --- a/src/main/java/com/github/hcsp/datatype/IntegerOverflow.java +++ b/src/main/java/com/github/hcsp/datatype/IntegerOverflow.java @@ -4,8 +4,8 @@ public class IntegerOverflow { // 修复这个方法里的问题,使得它正确输出 "i=3000000000" // Fix this method to make it output "i=3000000000" public static void main(String[] args) { - int 十亿 = 10_0000_0000; - int i = 0; + long 十亿 = 10_0000_0000; + long i = 0; i = i + 十亿; System.out.println("i=" + i);