title: Generating Random Numbers from 1 to n-1 for BigIntegers in Java
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2290057/how-to-generate-a-random-biginteger-value-in-java">How to generate a random BigInteger value in Java?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm using BigInteger class in JAVA, and I want to generate random numbers from <code>1 to x-1</code> . I'm not sure how to do that?</p>
  
  <p>I cannot use <code>nextInt()</code> since it only accepts <code>int</code> not <code>BigIntegers</code> also, I'll be generating 32bit and above numbers so, even <code>nextInt()</code> will not work.</p>
  
  <p>I know If I search I may find some helpful solutions, but I'm so short in time. (2 hours before deadline)</p>
  
  <p>Thanks in Advance.</p>