fork(5) 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<String> result = new ArrayList<String>(num);
  19. System.out.println(Arrays.toString(result.toArray()));
  20. }
  21. }
Success #stdin #stdout 0.1s 320256KB
stdin
Standard input is empty
stdout
[3, 6, 3, 8, 5]