is that REALLY your code? why do you use "equals" for the first condition, and "==" for the second?
also, what is 'N'? is that a variable? if so, what is the value of 'N'? Even if it is a reference to a string, odds are you don't want "==" there...
also, and I'm not sure of this, but if you are getting your input for 'again' from the command line, there may be a new-line character on the end (since you do, after all, hit 'enter' on the command line, right?). So you may need to strip is off. I'd try printing 'again' by itself somewhere to make sure it's what you think it is. if you do this:
System.out.println(":" + again + ":");
you can see if the second ':' is on the same line or not... [ September 25, 2008: Message edited by: fred rosenberger ]
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Feb 26, 2008
sory for that unclean code there actually this is the real code on my program:
the program intends to accept an input if the user wants to try again. If the user enters Y, the program should say "hi", otherwise.."Bye". However non of this conditions' printlines are displayed. any advice will be very much appreciated.