Advertisement
Guest User

jjjjj

a guest
Feb 26th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1.  
  2. import java.util.*;
  3.  
  4. public class squarem {
  5. public static void main(String args[]) {
  6.  
  7. ArrayList al = new ArrayList();
  8. System.out.println("Initial size of al: " + al.size());
  9.  
  10.  
  11. al.add("C");
  12. al.add("A");
  13. al.add("E");
  14. al.add("B");
  15. al.add("D");
  16. al.add("F");
  17. al.add(1, "A2");
  18. System.out.println("Size of al after additions: " + al.size());
  19.  
  20.  
  21. System.out.println("Contents of al: " + al);
  22.  
  23. al.remove("F");
  24. al.remove(2);
  25. System.out.println("Size of al after deletions: " + al.size());
  26. System.out.println("Contents of al: " + al);
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement