After enhanced for loop was introduced with J2SE 1.5.x aka J5SE, I made it a delightful habit to use it. You know what I am talking about, right?

For example previously I used to write:

private gbWay() {
    ....
    for (Iterator i = countries.iterator(); i.hasNext();) {
        Country c = i.next();
        if(!c.isCrony()) c.attack();
    }
    ....
}

Now I write:

private gbWay() {
    ....
    for (Country c:countries) {
        if(!c.isCrony()) c.attack();
    }
    ....
}

Isn't it simpler? You bet.

However this beauty doesn't work everywhere. First of all you cannot use it in cases where you need to access the Iterator itself like:

for (Iterator c = countries.iterator(); i.hasNext(); )
    if (!c.next().isCrony()) {
        c.remove();
    }
}

You cannot also use it when you want to add elements to the Collection which you are iterating. In fact you cannot use Iterator also. Can you guess how would you do it?