fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. // your code goes here
  10. ArrayList<ArrayList<Integer>> lists = new ArrayList<ArrayList<Integer>>();
  11. lists.addAll(Collections.nCopies(5, new ArrayList<Integer>()));
  12. lists.get(0).add(1);
  13. System.out.printf("%d", lists.get(3).size());
  14.  
  15. }
  16. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
1