fork download
  1. import java.util.*;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. ArrayList<String> x = new ArrayList<String>();
  6. x.add("1");
  7. addTwo(x);
  8. addThree(x);
  9. System.out.println(x);
  10. }
  11. private static void addTwo(ArrayList<String> x) {
  12. x.add("2");
  13. }
  14. private static void addThree(ArrayList<String> x) {
  15. x.add("3");
  16. }
  17. }
Success #stdin #stdout 0.07s 215552KB
stdin
Standard input is empty
stdout
[1, 2, 3]