Allocating byte array to get 4 billion bits
<p>I was reading this book entitled, Cracking the Coding Interview by Laakman. There is this part where she (the author p.g. 202) did:</p>

<pre><code>byte[] bitfield = new byte [0xFFFFFFF/8];//there are 7 F's
</code></pre>

<p>She was allocating 4 billion bits. However, isn't 0xFFFFFFF = 2^28-1? Thus, she has only allocated a byte array of 2^28-1/8 bytes, which is not remotely close to 4 billion bits. It is only 2^28-1 bits. My question is- is she wrong or am I doing something wrong? How do we allocate 4 billion bits? I have tried:</p>

<pre><code>byte[] bitfield = new byte[0xfffffff *2];
</code></pre>

<p>Although the above causes the jvm to run out of heap space.</p>

<p>While we are at it, what is the best was to express hex values? e.g. 0xffffffff or 0xFFFFFFFF?</p>
