OnJava8-Examples/operators/Overflow.java
Bruce Eckel 49edcc8b17 reorg
2015-06-15 17:47:35 -07:00

16 lines
372 B
Java

//: operators/Overflow.java
// ©2015 MindView LLC: see Copyright.txt
// Surprise! Java lets you overflow.
public class Overflow {
public static void main(String[] args) {
int big = Integer.MAX_VALUE;
System.out.println("big = " + big);
int bigger = big * 4;
System.out.println("bigger = " + bigger);
}
} /* Output:
big = 2147483647
bigger = -4
*///:~