title: random unique number in java
body: <p>I'm trying to get a a list of random number and put it in queue without any repetition of the random number.</p>
  
  <pre><code>        int number = 40;
  
          for (int j = 0; j&lt;number; j++)
          {
              int pick = random.nextInt(number);
              myQueue.add(Integer.toString(pick));
          }
          System.out.println("the queue size: "+myQueue.size());
          Iterator it = myQueue.iterator();
          while(it.hasNext()){
                  String iteratorValue = (String)it.next();
                  System.out.println("queue next value: "+iteratorValue);
          }
  </code></pre>
  
  <p>with the above code, I got some repetition of the random number</p>
  
  <p>anyone know how to do it??</p>