Everything about this code works fine, except the while loop won't end, even when the strings are perfectly matched. Help, please?

import java.util.Scanner;


public class SecretPhrase
{

	public static void main(String[] args)
	{

		System.out.println("Congratulations! You won! Thanks for playing!");
			
		
	} 

}

Don't use == or != to compare Strings. Use the equals() method.

Also indent you loops and if() blocks. It makes the program flow much easier to follow.

commented: Very helpful. +0