Thursday, August 18, 2011

Do..while loop in Java..help please!?

Your "play" variable is a local variable. The Java compiler never igns a default value to an uninitialized local variable. Although the do-while loop will run once before it tries to evaluate what "play" is set to, in order to compile, Java needs to be ured that "play" is set. So when you declare the "play" variable, just ign a true or false initial variable and it should compile just fine.

No comments:

Post a Comment