title: How to generate 4 digit random numbers in java from 0000 to 9999
body: <p>I tried the following</p>
  
  <pre><code>int number = ThreadLocalRandom.current().nextInt(1000, 9999 + 1);
  </code></pre>
  
  <p>But it won't generate 4 digit numbers like 0004,0035 and so on...</p>
  
  <p>I searched for similar questions but none solved, they were different from what I need, if there's already an existing question please let me know.</p>
  
  <p>I need no genarate numbers like 1485 and 0180, not only numbers starting with 0.</p>