diff --git a/src/main/java/com/bytelegend/IntegerOverflow.java b/src/main/java/com/bytelegend/IntegerOverflow.java index b45bc3d..45d82c7 100644 --- a/src/main/java/com/bytelegend/IntegerOverflow.java +++ b/src/main/java/com/bytelegend/IntegerOverflow.java @@ -3,7 +3,7 @@ public class IntegerOverflow { public static void main(String[] args) { int oneBillion = 1_000_000_000; - int i = 0; + long i = 0; i = i + oneBillion; System.out.println("i=" + i);