Whatever[] w = new Whatever[Integer.MAX_VALUE * 2];long. (Which should be free on a 64-bit computer, right?) I’ll go update the binary-search article to add this caution. [Update: Maybe not. Greg Thompson and A. Sundararajan both point out that the Java Language Definition requires array indices to be integers, not longs. So I wonder why this compiles?]