What do I need to fix to get this to print out a string of random characters?
<p>This is in Java as the tag implies. I can't figure out how to get it to print out the "key" string at the end of the code while keeping my variables the way they are. I've only really worked with static main, and I have no idea what that does for programs as I'm a total novice. Can someone point me in the right direction? I'd like to know what you all think!</p>

<pre><code>import java.util.Random;

class Key {

    private String key = new String();
    private void main(String[] args) {
        Random r = new Random();

        for (int i = 10; i &gt; 0; i--) {
            int randomNumber = r.nextInt(10) + 48;
            int randomLetter = r.nextInt(26) + 97;
            int branchSwitch = r.nextInt(2);

            if (branchSwitch == 1) {
                // System.out.print((char)randomNumber);
                key = key + (char) randomNumber;
            } else
                key = key + (char) randomLetter;
            // System.out.print((char)randomLetter);
        }
        System.out.print(key);
    }
}
</code></pre>
