title: Checking one dimensional array for duplicate integers Java
body: <p>hey guys,
         right i have an array of 50 random integers and i have to check if any of them are the same,
  here is my code so far it only checks ajacent indexs</p>
  
  <pre><code>for (int i =0; i &lt; 50; i++)
  {
      System.out.print("Student" + i + ": "   );
  
      customers[i] = (int)((Math.random()*10000)%10+1);
      System.out.print(" " +customers[i]+ "\n");
  
  
  
      if( duplicate == customers[i])
      {
          System.out.println("yup");
      }
      duplicate = customers[i];
  }
  </code></pre>