title: Java: How to read a text file
body: <p>I want to read a text file containing space separated values. Values are integers.
  How can I read it and put it in an array list?</p>
  
  <p>Here is an example of contents of the text file:</p>
  
  <pre><code>1 62 4 55 5 6 77
  </code></pre>
  
  <p>I want to have it in an arraylist as <code>[1, 62, 4, 55, 5, 6, 77]</code>. How can I do it in Java?</p>