I often see code like:
Iterator i = list.iterator(); while(i.hasNext()) { ... }
but I write that (when Java 1.5 isn\'t available or for
Academia tends to prefer the while-loop as it makes for less complicated reasoning about programs. I tend to prefer the for- or foreach-loop structures as they make for easier-to-read code.