title: NoSuchElementException when reading input from command line
body: <p>I am trying to read input from the command line and put it in an <code>ArrayList</code>. I do it multiple times in the program but one time is throws the <code>NoSuchElementException</code>. What am I doing wrong?</p>
  
  <pre><code>public static ArrayList&lt;Double&gt; getInfoTwo ()
  {
      ArrayList&lt;Double&gt; infoListTwo = new ArrayList&lt;Double&gt;();
      Scanner in = new Scanner(System.in);
      System.out.println("Please enter your total hours: ");
      infoListTwo.add(in.nextDouble());
      in.close();
      return infoListTwo;
  }
  </code></pre>