fred rosenberger wrote:Don't think we're beating up on you, but I'd like to make another suggestion. always always ALWAYS use braces. Some day, you're going to revisit some code and thing "I need to do something else here, like a System.out.println()". You'll stick it in, and things will REALLY go crazy because something won't be in the loop anymore. It really doesn't cost that much to always have them, and personally, I find code much easier to read with them in there.
Indentation alone isn't enough to see what is part of what. in your code below, your "if" on line 33 in indented more than your 'while' on line 20, but less than the if on line 23. it's confusing as to whether this should be inside the loop or not.
+1 on this. Braces are a coder's best friend, in my opinion.
SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."