title: Java - getting a random number from 100 to 999
body: <p>Please tell me whether I am correct or not with the following line.</p>
  
  <pre><code>int x = ((int)(Math.random() * 100000)) % 1000;
  </code></pre>
  
  <p>This line always give me a <code>3</code> digit number <code>100</code> to <code>999</code> ?</p>
  
  <p>Is there an easier way to type this out? Did I over complicate this code? </p>