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 © 2007, Robert Sedgewick and Kevin Wayne.
Last updated: Tue Sep 29 16:17:41 EDT 2009.