In this code if I input 'N' or 'n' the register method get called.But if I input 'l' or 'L' the login method doesnt get called.I swapped
"if "and "if else" code parts and tried again.That time the Login method did get called ,and register method wasn't activated.So the problem is with the if else code parts .Not with those methods code parts.Please Someone help me to pint out this error.It may bea very simple one.But cannot figure out it at the moment.
[Bsc in Computer Science and Engineering] [SCJP 80%][BCS certificate level]
Well, assuming that input is a scanner object... basically your code... gets a token from the user and checks if the first letter is "N", if it isn't, it will get another token from the user and checks if the first letter of this new token is "n", if it isn't, it will get another token from the user and checks if the first letter of this new token is "l", if it isn't... so, if you want an "L", you will have to enter it 4 times, with spaces in-between, so that your condition will pass its test. Is this what you wanted?
Thanks for all you people who replied for my question.And after posting my question I found a way to solve my problem.It was exactly the same method Preity has mentioned.And Henry,Yes You are correct about that.Thanks for that valuable tip.