title: Trying to read from a text file, store it into an an arrayList and print the stored information unto my screen. Why is my output empty?
body: <p>Would like to print out the stored information. How can I solve this issue?</p>
  
  <pre><code>public class schoolTimeTable {
  
      private static ArrayList&lt;String&gt; timesArray = new ArrayList&lt;String&gt;();
  
  
      public static void main(String[] args) {
  
          Scanner scanner = null;
  
          try {
  
  
          File file = new File("C:/Users/Tommy/workspace/Prov/src/TestPaket/text.txt");
          scanner = new Scanner(file);
          while(scanner.hasNextLine()){
  
              String[] tokens = scanner.nextLine().split("\\s+");
  
              String[] times = tokens;
              for(String time: times)
              timesArray.add(time);
              System.out.println(timesArray); 
  
  
  
          }} catch (Exception e) {
          // TODO: handle exception
      }
  
  }}
  </code></pre>