title: When trying to read multiple inputs using a scanner, I can't make it read integers and chars
body: <p>Here is the code</p>
  
  <pre><code>    public void promptUser(){
          Scanner scan = new Scanner(System.in);
          System.out.print("Pick a coordinate [row col] or press [q] to quit.");
          int row = 0;
          int row = 0; 
          String line = scan.nextLine().trim();
          String[] contents = line.split(" ");
          if (contents[0] == "q"){
              isRunning = false;
              System.exit(0);
          }// if quit
          if (contents.length &lt; 1 || contents.length &gt; 2){
              System.out.print("Invalid Response. Try again.");
              promptUser();
          }// if wrong amount of input
          else {
              row = Integer.parseInt(contents[0]);
              col = Integer.parseInt(contents[1]);
          }// parse ints else
          if (inBounds(row, col) == true){
              if(!(board[row][col] == 'c'){
                  click(row, col);
              }// has been clicked
          }// in bounds?
          else{
              System.out.print("Invalid response. Try again.");
              promptUser();
          }// else error
      }// promptUser method
  </code></pre>
  
  <p>and here is the error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NumberFormatException: For input string: "q"    
       at    java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)    
  at java.lang.Integer.parseInt(Integer.java:481)     
  at java.lang.Integer.parseInt(Integer.java:514)    
  at Minesweeper.promptUser(Minesweeper.java:197)    
  at Driver.main(Driver.java:12)     
  </code></pre>
  
  <p>This method is meant to get input from the user, check it for errors. If it is correct, then it should exit the program if "q" is entered and "click" the coordinate if it is two integers inside the bounds that have not already been clicked. I can't enter 'q' without this error. I also get an <code>outOfBounds exception</code> with any integers entered. (Yes, this is homework, and I've searched long and hard, but haven't quite found out how to fix this.)
  Any and all help is GREATLY appreciated.</p>
  
  <p>Here is the inBounds method I use, and the initialize (where the board is initialized)</p>
  
  <pre><code>    public void initialize(){
      isRunning = true;
      board = new char[this.rows][this.cols];
      for (int i = 0; i &lt; board.length; i++){
          for(int j = 0; j &lt; board[i].length; j++){
              board[i][j] = 'e';
  
          }
      }
      mineBoard = new boolean[this.rows][this.cols];
  
      for (int i = 0; i &lt; mineBoard.length; i++){
          for (int j = 0; j &lt; mineBoard[i].length; j++){
              mineBoard[i][j] = false;
          }
      }
      Random bob = new Random();
      Random sally = new Random();
      for (int i = mines; i &gt; 0; i--){
          int mineX = bob.nextInt(10);
          int mineY = sally.nextInt(10);
          if (mineBoard[mineX][mineY] == false){
              mineBoard[mineX][mineY] = true;
          }
          else{
              i++;
          }
      }
  
  }
  </code></pre>
  
  <p>That's the initialize...
  and here is the inBounds</p>
  
  <pre><code>    private boolean inBounds(int row, int col){
          if (row &lt; 0 || row &gt; board.length){
              return false;
          }
          if (col &lt; 0 || col &gt; board[0].length){
              return false;
          }else
              return true;
          }
  </code></pre>
  
  <p>is there anything else that would help? I fixed the problem with q, but I keep having problems with the out of bounds thing.</p>