title: How to create 32 bit mask in Java
body: <p>So far I have this code to create 16 bit mask. However I do not know how to create a 32 bit mask using this approach. Any ideas?    </p>
  
  <p>edit: I want to create 32 masks of 32 bits, each with with its respective bit being 1 and the rest of the bits being zero. For example: mask 1 has the leftmost bit being 1 while the rest of the bits are zero, mask 2 has the 2nd leftmost bit being 1 while the rest of the bits are zero. I dunno how to explain more succinctly but I hope you guys get the idea... </p>
  
  <pre><code>mask = new int[16];
  mask[0] = 0x8000;
  mask[1] = 0x4000;
  mask[2] = 0x2000;
  mask[3] = 0x1000;
  
  mask[4] = 0x0800;
  mask[5] = 0x0400;
  mask[6] = 0x0200;
  mask[7] = 0x0100;
  
  mask[8] = 0x0080;
  mask[9] = 0x0040;
  mask[10] = 0x0020;
  mask[11] = 0x0010;
  
  mask[12] = 0x0008;
  mask[13] = 0x0004;
  mask[14] = 0x0002;
  mask[15] = 0x0001
  </code></pre>