title: I keep getting "Exception in thread "main" java.util.NoSuchElementException"
body: <p>So I'm trying to make a simple program in Java that reads a text file (from a command line argument) and the user can check to see if a number they input is in the text file.</p>
  
  <pre><code>File inputFile = new File(args[0]);
  Scanner scanman = new Scanner(inputFile); //Scans the input file
  Scanner scanman_2 = new Scanner(System.in); //Scans for keyboard input
  int storage[] = new int[30]; //Will be used to store the numbers from the .txt file
  
  for(int i=0; i&lt;storage.length; i++) {
    storage[i]=scanman.nextInt();
    }
  System.out.println("WELCOME TO THE NUMERICAL DATABASE"+
                    "\nTO CHECK TO SEE IF YOUR NUMBER IN THE DATABASE"+
                    "\nPLEASE ENTER IT BELOW! TO QUIT: HIT CTRL+Z!");
  while(scanman_2.hasNext()){
    int num_store = scanman_2.nextInt();
    boolean alert = false;
    for (int i=0; i&lt;storage.length; i++) {
       if(storage[i]==num_store){
          alert=true;
          }
       }
    if (alert) {
       System.out.println("Yep "+num_store+" is in the database\n");
       }
    else {
       System.out.println("Nope, "+num_store+" is not in the database\n");
       }
    }
  System.out.println("See ya!");                
    }
  }
  </code></pre>
  
  <p>Everytime I attempt to run it I keep getting:</p>
  
  <pre><code>Exception in thread "main" java.util.NoSuchElementException
  at java.util.Scanner.throwFor(Scanner.java:907)
  at java.util.Scanner.next(Scanner.java:1530)
  at java.util.Scanner.nextInt(Scanner.java:2160)
  at java.util.Scanner.nextInt(Scanner.java:2119)
  at Database.main(Database.java:17)
  </code></pre>
  
  <p>I've done a program similar to this and had no problems. Does anyone know what I'm doing wrong?</p>