title: Java pipe & ampersand with integers
body: <p>I was searching around on the internet when I came across a snippet of code that looked like this -
  <code>return c.getX() | c.getY() | c.getZ();</code><br>
  The accessor methods return integers, so it got me thinking, <strong><em>What does it mean if you put an &amp; or | between integers?</em></strong><br>
  So I tried it out for myself~</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>for (int x = 0; x &lt; 5; x++)
    for (int z = 0; z &lt; 5; z++) {
  
      System.out.printf("%s | %s = %s\t%s &amp; %s = %s\n", x, z, x | z, x, z, x &amp; z);
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here's what I got~</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>0 | 0 = 0 0 &amp; 0 = 0
  0 | 1 = 1 0 &amp; 1 = 0
  0 | 2 = 2 0 &amp; 2 = 0
  0 | 3 = 3 0 &amp; 3 = 0
  0 | 4 = 4 0 &amp; 4 = 0
  1 | 0 = 1 1 &amp; 0 = 0
  1 | 1 = 1 1 &amp; 1 = 1
  1 | 2 = 3 1 &amp; 2 = 0
  1 | 3 = 3 1 &amp; 3 = 1
  1 | 4 = 5 1 &amp; 4 = 0
  2 | 0 = 2 2 &amp; 0 = 0
  2 | 1 = 3 2 &amp; 1 = 0
  2 | 2 = 2 2 &amp; 2 = 2
  2 | 3 = 3 2 &amp; 3 = 2
  2 | 4 = 6 2 &amp; 4 = 0
  3 | 0 = 3 3 &amp; 0 = 0
  3 | 1 = 3 3 &amp; 1 = 1
  3 | 2 = 3 3 &amp; 2 = 2
  3 | 3 = 3 3 &amp; 3 = 3
  3 | 4 = 7 3 &amp; 4 = 0
  4 | 0 = 4 4 &amp; 0 = 0
  4 | 1 = 5 4 &amp; 1 = 0
  4 | 2 = 6 4 &amp; 2 = 0
  4 | 3 = 7 4 &amp; 3 = 0
  4 | 4 = 4 4 &amp; 4 = 4</code></pre>
  </div>
  </div>
  </p>
  
  <p>I was trying to find a pattern, but I couldn't come to any conclusion. Can anyone tell me the pattern and use of this?</p>