title: Java constructor cannot find symbol error ' = new'
body: <p>I am trying to initialize one Java class from within a conditional in another class - I want MarsRovers to initialize Rover. I am getting a 'cannot find symbol' error when I try to initialize a Rover object from MarsRovers. I am new to Java so I have a feeling it has something to do with the scope of plateauCoords and inputLines. I've tried other solutions I've seen on here, but they aren't working for my problem (like making my variables public).</p>
  
  <p>The goal is to eventually make a new Rover as long as inputLines % 2 is equal to 0 (with an until loop).</p>
  
  <p>Here is the MarsRover code:</p>
  
  <pre><code>import java.io.File;
  import java.io.FileNotFoundException;
  import java.util.*;
  
  public class MarsRover {
    public static void main(String []args) throws FileNotFoundException {
      Scanner console = new Scanner(System.in);
      System.out.println("Mars rover is ready for input, please enter name of input file: ");
      String filename = console.nextLine();
      console.close();
      List&lt;String&gt; inputLines = new ArrayList&lt;String&gt;();
  
      Scanner scanner = new Scanner(new File(filename));
      scanner.useDelimiter("\n");
      while(scanner.hasNext()){
        inputLines.add(scanner.next());
      }
      String plateauCoords = inputLines.get(0);
      inputLines.remove(0);
      scanner.close();
      System.out.println(inputLines);
  
      if(inputLines.size() % 2 == 0) {
        MarsRover rover = new Rover(plateauCoords, inputLines);
      } else {
        System.out.println("Your directions are not formatted correctly");
      }
    }
  }
  </code></pre>
  
  <p>And here is the Rover code:</p>
  
  <pre><code>import java.io.File;
  import java.io.FileNotFoundException;
  import java.util.*;
  
  public class Rover {
    public Rover(String platCoords, String[] input) {
      System.out.println("INSIDE ROVER");
    }
  }
  </code></pre>
  
  <p>When I compile MarsRovers.java, I get this error:</p>
  
  <pre><code>MarsRover.java:27: cannot find symbol
  symbol  : constructor Rover(java.lang.String,java.util.List&lt;java.lang.String&gt;)
  location: class Rover
        MarsRover rover = new Rover(plateauCoords, inputLines);
                          ^
  1 error
  </code></pre>