title: How to print a string if all values in an array are the same
body: <p>I have an array that holds numbers:</p>
  <pre><code>int tarningar[] = new int[5];
  </code></pre>
  <p>When all the numbers are the same, I want to print &quot;OK&quot;, e.g. with something like <code>system.out.println('ok');</code>. I have tried <code>if(tarningar[1] == tarningar[2] &amp;&amp; tarningar[3] == tarningar[4])</code>, but then I am missing <code>tarningar[0]</code>.</p>
  <p>How can I do this?</p>