Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<String> myList = new ArrayList<String>();
- myList.add("1");
- myList.add("2");
- myList.add("3");
- myList.add("4");
- myList.add("5");
- Iterator<String> it = myList.iterator();
- while(it.hasNext()){
- String value = it.next();
- System.out.println("List Value:"+value);
- if(value.equals("3")) myList.remove(value);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement