What I want to happen is that once the user entered wrong username or password the program will then loop. But if the user entered the correct username or password, it wont loop asking the user for the correct one.
I'm new on this site but i know Core Java And Adv. Java very well.. So here is solution to u r problem if u have not got it yet. First use assigment operator == in while loop In your code loop will keep executing till the value of tryAgain is true . if u want loop to stop right after correct value of username and password u need to make tryAgainfalse in first if block and make tryAgaintrue in second if block. it will work properly