Originally posted by Samuel Molina:
Besides, as far as I know, you CAN'T mix initializations AND declarations in the init part of the For loop.
Welcome to
Java Ranch, Samuel.
Just a note to say that you can indeed define new variables in the init part of the for loop, so long as they are all of the same type. In other words, you can have ONE valid statement in the init part.
Note that the OP indicated that she was having an unexpected outcome which suggests a runtime issue (implying she got her code to compile).
- Anand
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery