for (Iterator<String> i = someIterable.iterator(); i.hasNext();)
{
String item = i.next();
System.out.println(item);
}
Note that if you require to use i.remove(); in your loop, or access the actual iterator in some way, you cannot use the for ( : ) idiom, since the actual iterator is merely inferred.
The code above works for any object that implements the Iterable interface.
Also, if the right-hand side of the for ( : ) expression is an array rather than an Iterable element, the internal code practices an int index counter and checks on array.length instead. See this to know more.