title: Scanner error that I can't figure out: NoSuchElementException
body: <p>It's crashing on the third line inside the do-while loop, and doesn't wait for my input:</p>
  <pre><code> input = kb.nextInt();
  </code></pre>
  <p>Stack trace:</p>
  <blockquote>
  <p>Exception in thread &quot;main&quot; java.util.NoSuchElementException</p>
  <p>at java.util.Scanner.throwFor(Unknown Source)</p>
  <p>at java.util.Scanner.next(Unknown Source)</p>
  <p>at java.util.Scanner.nextInt(Unknown Source)</p>
  <p>at java.util.Scanner.nextInt(Unknown Source)</p>
  <p>at main.MainDriver.main(MainDriver.java:50)</p>
  </blockquote>
  <p>Relevant code:</p>
  <pre><code>do
      {
          displayFullMenu();
          System.out.print(&quot;Selection: &quot;);
          input = kb.nextInt();
          
          switch (input)
          {
          //Create new survey
          case 1:     currentSurvey = new Survey();
                      break;
          
          //Display current survey            
          case 2:     currentSurvey.display();
                      break;
          
          //Save current survey           
          case 3:     saveSurvey(currentSurvey);
                      break;
                      
          //Load a survey
          case 4:     currentSurvey = loadSurvey();
                      break;
          
          //Modify a survey
          case 5:     currentSurvey.modify();
                      break;
                      
          /*******************Test Functions*******************/
                      
          //Create new test
          case 6:     currentSurvey = new Test();
                      break;
          
          //Display current test
          case 7:     currentSurvey.display();
                      break;
          
          //Save current test
          case 8:     saveSurvey(currentSurvey);
                      break;
                      
          //Load a test
          case 9:     currentSurvey = loadTest();
                      break;
                      
          //Modify a test
          case 10:    currentSurvey.modify();
                      
          default:    System.out.println(&quot;Invalid choice. Please make a valid choice: &quot;);
                      input = kb.nextInt();
                      System.out.println();
          }
      } while (input != 99);
      kb.close();
  </code></pre>
  <p>It crashes after I choose option 9. It saves the file correctly, then goes back to the top of the loop, and crashes at the previously mentioned line. I want it to ask for more input.</p>
  <p>What gives?</p>