title: Java storing two ints in a long
body: <p>I want to store two ints in a long (instead of having to create a new <code>Point</code> object every time).</p>
  
  <p>Currently, I tried this. It's not working, but I don't know what is wrong with it:</p>
  
  <pre><code>// x and y are ints
  long l = x;
  l = (l &lt;&lt; 32) | y;
  </code></pre>
  
  <p>And I'm getting the int values like so:</p>
  
  <pre><code>x = (int) l &gt;&gt; 32;
  y = (int) l &amp; 0xffffffff;
  </code></pre>