Hi
The syntax of while loop is
The expression should evaluate to a true or false.
Why don't we declare the variable inside?
I quote from the Kathy Sierra book as to why we can't declare the variable used in the condition expression where you pointed
Instead of testing the variable, you'd be declaring
and initializing it, so it would always have the exact same value
Hope that helps, and if it does, mentally thank Kathy(or you can do better, buy the book
)
Jhakda
If I become filthy rich, I'll sponsor research for painless dental treatment at Harvard Medical School. Thats why,I'm learning Java.I have 32 teeth, 22 are man made.