Overflow.java


Below is the syntax highlighted version of Overflow.java from §5.1 Data Representations.


public class Overflow { 

    public static void main(String[] args) { 

        int a = 2147483647;   // 2^31 - 1
        int b = a + 1;

        System.out.println("a = " + a);
        System.out.println("b = " + b);
    }

}


Copyright © 2000–2011, Robert Sedgewick and Kevin Wayne.
Last updated: Wed Feb 9 09:20:16 EST 2011.