Guest User

Untitled

a guest
Jul 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. package com.test.java;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Iterator;
  5. import java.util.List;
  6.  
  7. public class IllegalStateExceptionDemo {
  8.  
  9. public static void main(String[] args) {
  10. // TODO Auto-generated method stub
  11. List al = new ArrayList();
  12. al.add("Sachin");
  13. al.add("Rahul");
  14. al.add("saurav");
  15. Iterator itr = al.iterator();
  16. while (itr.hasNext()) {
  17. itr.remove();
  18. }
  19. }
  20. }
Add Comment
Please, Sign In to add comment