I'm attempting to make a text based adventure game inspired by the Tomb of Horrors in Java as part of my final project for programming class. There are four classes, the PlayerCharacter class which handles the players stats and assigns a class, the gameLauncher class which launches the game, the Dungeon class which has the adventure, and EasyReader to read console input. 

My method chooseClass is used to let the user select a class to get more information, and then decide if that class is the one they want to play. However, after looking at one player class and deciding not to play as it, entering a new number to view another player class produces an error.

```
public void chooseClass()
{
    int ready = 0;
    int num;
    String selection;
    EasyReader console = new EasyReader();

    while (!false)
    {
        System.out.println(" Choose a Class! Type 1 for Fighter, 2 for rogue, 3 for wizard, and 4 for cleric.");

        System.out.print(" Upon selecting a class, the class info will be displayed. ");

        inputThing();
        selection = console.readLine();
        num = Integer.parseInt(selection);

        if (num == 1)
                {
                    System.out.println("The fighter is armed with a greatsword and is clad in the finest of platemail, with the highest hp in the game of 50, the fighter "); 
                    System.out.println("is the best character for solving your problems by hitting things. The fighter starts with 2 health potions,");
                    System.out.println("is able to use power attack 5 times per day, and is able to enrage himself twice per day");
                    System.out.println("1 = yes or 2 = no");
                    String select = console.readLine();
                    int yesno = Integer.parseInt(select);
                            if (yesno == 1)
                                    {

                                    fighterClass();

                                    break;
                                    }
                            else 
                            {
                                num = 0;
                            }
                }                   
        else if (num == 2)
                    {
                        System.out.println("The rogue is armed with a simple dagger, a sling, and thieves tools, allowing him to easily disarm most traps.");
                        System.out.println(" Clad in leather armor and with an hp of 36 the rogue relies on weakening foes from afar with his sling before");
                        System.out.println("using his stealth skill to hide and use his backstab ability to deal large amounts of damage, before hiding again to avoid retaliation.");
                        System.out.println(" The rogue is the best at finding and disarming traps and starts with 3 health potions, because the rogue stole one from the cleric.");
                        System.out.println("1 = yes or 2 = no");
                        String select = console.readLine();
                        int yesno = Integer.parseInt(select);
                            if (yesno == 1)
                                        {
                                            ready++;
                                            rogueClass();                                               
                                        }
                            else 
                            {
                                num = 0;
                            }
                    }                   
        else if (num == 3)
                {
                    System.out.println("The wizard is armed with a simple wizard staff and is clad in fine wizard robes. As nice as they look, they ");
                    System.out.println("fail to offer much protection to his pitiful hp of 20. The wizard relies on using his vast array of powerful spells to finish of enemies ");
                    System.out.println("before they have a chance to attack him. The wizard is adept at finding and disarming traps, and has access to mage hand");
                    System.out.println("to open doors from afar. The wizard may use magic missle as many times as they like, may cast any combination of freezing ray,");
                    System.out.println(" thunderclap, or wizard shield 10 times per day, and any combination of fireball, necrotic blast, cure light wounds, and ");
                    System.out.println("mega magic missile 5 times per day. The wizard has 2 health potion");
                    System.out.println("1 = yes or 2 = no");
                    String select = console.readLine();
                    int yesno = Integer.parseInt(select);
                        if (yesno == 1)
                                {

                                        wizardClass();
                                        break;
                                }
                        else 
                        {

                        }

                }
        else if (num == 4)
                {       
                    System.out.println("The Cleric is armed with a warhammer and a light shield, and is clad in chainmail. With an hp of 40, the cleric relies on"); 
                    System.out.println("his decent close combat skills and can invoke the power of the sun to boost his attacks  against tough enemies."); 
                    System.out.println("The cleric may also invoke the power of the sun to smite undead monsters, dealing extreme amounts of damage to them.");
                    System.out.println(" The cleric may cast any combination of cure light wounds,holy wrath, sacred flame,or smite undead 6 times per day.");
                    System.out.println("The cleric may also cast any combination of cure serious wounds,bastion of faith, and lance of faith 3 times per day.");
                    System.out.println("The cleric has 1 health potion, because the rogue stole one.");
                    System.out.println("1 = yes or 2 = no");
                    String select = console.readLine();
                    int yesno = Integer.parseInt(select);
                            if (yesno == 1)
                                        {

                                        clericClass();
                                        break;
                                        }
                            else 
                            {

                            }
                }                               
        else 
            {
            System.out.println("That is not a valid input. Get it together man.");

            }
    }

}

```

This method is called in the dungeon class method makeClass

```
public void makeClass()
{
    PlayerCharacter v1 = new PlayerCharacter("Michael");
    v1.chooseClass();
    setclass = v1.checker();
}

```

which is used in the test class, gameLauncher.

```
while(!false)
    {

        Dungeon horror = new Dungeon();
        v1.pressEnterToProceed();

        horror.makeClass();

        while(v1.getHP() > 0 )
        {

            horror.mover();

        }

        int end;
        System.out.println(" Type 1 to try again, and 2 to quit.");
        end = Integer.parseInt(console.readLine());
        if (end == 2)
            break;

     }

```

I have tried setting the num variable to 0 in the else statements, tried moving the variables into the while loop, but nothing has worked. Help would be much appreciated.

```
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at tombofhorrors.PlayerCharacter.chooseClass(PlayerCharacter.java:46)
at tombofhorrors.Dungeon.makeClass(Dungeon.java:24)
at tombofhorrors.gameLauncher.main(gameLauncher.java:37)

```

Here is the error, as requested.