title: List of List in for loops Java
body: <p>I have problem. I try to do develop 
  Program ask me for some numbers a few times. I give list of numbers. I try to save them in  List>. Numbers can be split by space. Now I have this code :</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  import java.util.Scanner;
  public class TimeSeries {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
  
      System.out.println("Numbers of rows:");
      Scanner in = new Scanner(System.in);
      int NumberLines = in.nextInt();
      in.nextLine();
      String Ciag;
      List&lt;List&lt;Integer&gt;&gt; ll = new ArrayList&lt;List&lt;Integer&gt;&gt;();
      List&lt;Integer&gt; list = new ArrayList&lt;Integer&gt;();
      for (int i = 0; i &lt; NumberLines; i++) {
          list.clear();
          System.out.println("Add row " +(i+1));
          Ciag = in.nextLine();
          for (int t=0; t&lt;Ciag.length(); t++) {
  
              if(Character.isWhitespace(Ciag.charAt(t)))
              {
  
              }
              else
              {list.add(Character.getNumericValue(Ciag.charAt(t)));
              }
  
          }
  
          System.out.println(list);
          ll.add(list);
          }
  
      System.out.println(ll);
  
  }
  
  
      }
  </code></pre>
  
  <p>But my output is (example) :</p>
  
  <pre><code>Numbers of rows:
  3
  Add row 1
  0 0 0
  [0, 0, 0]
  Add row  2
  1 2 3
  [1, 2, 3]
  Add row  3
  54 6 8
  [5, 4, 6, 8]
  [[5, 4, 6, 8], [5, 4, 6, 8], [5, 4, 6, 8]]
  </code></pre>
  
  <p>But I need to have [[0,0, 0], [1, 2, 3], [5, 4, 6, 8]]</p>