It's legal and technically correct Java, but I prefer to write such things like this:
while (iterator.hasNext()) {}
to make it obvious that it's an empty block.
Sandro Martini wrote:
> Hi, in ArrayList I've just found a warning ... in equals()
>
> while (iterator.hasNext()
> && arrayListIterator.hasNext()
> && iterator.next().equals(arrayListIterator.next()));
>
> => there is a ; after the while ... is it right ??
>
> equals = (!iterator.hasNext()
> && !arrayListIterator.hasNext());
>
>
> Bye
>
