title: Generating a Random Pin of 5 Digits
body: <p>I would like to generate Unique Pins based on a random number I have found this on Stack Overflow <a href="https://stackoverflow.com/questions/7815196/how-to-generate-a-random-five-digit-number-java">How to generate a random five digit number Java</a>. That Question uses time to generate the numbers so therefore you get a lot of duplicates. </p>
  
  <p>Here is my code </p>
  
  <pre><code>public int createRandomPin() {
      int k = random.nextInt(Integer.SIZE);
      k = (k + 1) * 9999;
      if (9999 &gt; k || k &gt; 99999) {
          //then regenerate 
      } else {
          return k;
      }
  }
  </code></pre>
  
  <p>My Question</p>
  
  <p>Java Compiler then gives a warning missing "return". As well I need to restructure the code so that if it isn't a 5 digit pin it generates again before it "returns k".</p>