title: File input java, scanner using if.. else statment. error provided
body: <p>Ok guys so i am trying to read in from 1 out of 3 files normally with out the <code>if</code> ... <code>else</code> clause </p>
  
  <p>just <code>Scanner myScanner = new Scanner(new File("maze1.txt"));</code> would run the problem, but i want the user to select what maze he/she would like to run</p>
  
  <pre><code>public class Main {
      private static Scanner myScanner;
  
      public static void main(String[] args) throws FileNotFoundException {
  
          System.out.println("Please Enter 1,2 or 3 to pick the different maze you would like being solved.");
          Scanner myScannerinput = new Scanner(System.in);
  
  
  
          int Mazenumber = myScannerinput.nextInt();
  
          if(Mazenumber == 1){
              Scanner myScanner = new Scanner(new File("maze1.txt"));
          }
          else if(Mazenumber == 2){
              Scanner myScanner = new Scanner(new File("maze2.txt"));
          }
          else if(Mazenumber == 3){
              Scanner myScanner = new Scanner(new File("maze3.txt"));
          }
          else{
              System.out.println("You did not choose one of the 3 mazes");
          }
  
  
  
          int numRows = myScanner.nextInt();
          int numCols = myScanner.nextInt();
          myScanner.nextLine();
  
          int startX = 0;
          int startY = 0;'
  </code></pre>
  
  <p>Please Enter 1,2 or 3 to pick the different maze you would like being solved.</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
  at Main.main(Main.java:33)
  </code></pre>