fork(6) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. ArrayList<String> num = new ArrayList<String>();
  13. num.add("3");
  14. num.add("6");
  15. num.add("3");
  16. num.add("8");
  17. num.add("5");
  18. ArrayList<List<String>> result = new ArrayList<List<String>>();
  19. result.add(0, num);
  20. System.out.println(Arrays.toString(result.get(0).toArray()));
  21. }
  22. }
Success #stdin #stdout 0.1s 320320KB
stdin
Standard input is empty
stdout
[3, 6, 3, 8, 5]