From 067da250d5133c5756a3925998f92782281dfef6 Mon Sep 17 00:00:00 2001 From: chenxi <583643011@qq.com> Date: Sun, 15 Jan 2023 17:53:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AClong?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/github/hcsp/datatype/IntegerOverflow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);