title: Using setters/getters on a text file
body: <p>I am trying to make a list of coordinates from a text file and I want to be efficient with it, so I created a class that has a <code>latitude</code> and <code>longitude</code> double variables, along with their getter and setter methods.</p>
  
  <p>So in the other class I make an object of the previous class to use the setter methods.</p>
  
  <pre><code>CoordinatesParams params = new CoordinatesParams();
  </code></pre>
  
  <p>How can I read the list of coordinates from the text file and set them to the <code>latitude</code>and <code>longitude</code>variables?</p>
  
  <p>Sorry if this question is very basic to some</p>
  
  <pre><code>File Bus_Routes = new File("C:/Users/Daniel Dold/Desktop/Routes/Bus_Routes.txt");
  Scanner scanner = new Scanner(Bus_Routes);
  
  String line = scanner.nextLine();
  String[] parsed = line.split("\\s");
  String routeText = parsed[0];
  
  String dir = "C:/Users/Daniel Dold/Desktop/Routes/";
  File routeFile = new File(dir, routeText);
  Scanner sc = new Scanner(routeFile);
  while(sc.hasNextLine())
  {
      String line2 = sc.nextLine();
      String[] s = line2.split("\t");
  }
  </code></pre>
  
  <p>This is what I have so far to print the results on the file.</p>
  
  <pre><code>51.50177649 -0.05012445
  51.50210374 -0.05050666
  51.50253617 -0.0509908
  51.50265346 -0.05072191
  51.50274404 -0.05055025
  51.50301702 -0.05011841
  </code></pre>
  
  <p>The coordinates file are just 2 columns the first being latitude and the second longitude</p>