Random character for passkey?
<p>I am generating a random character for a passkey using following code:</p>

<pre><code>int randomNumber;
Random randomNumberGenerator = new Random();
randomNumber = randomNumberGenerator.nextInt(26) + 65;

if(passkey.length() != 20){
    while (passkey.length() != 20){
        passkey += (char)randomNumber; 
        randomNumber = randomNumber + 5;
    }
}
</code></pre>

<p>Further in the code sometimes I add 5 or 1 etc.</p>

<p>How do I make it so that the random character is numeric or alphanumeric not any punctuation?</p>
