Well , it depends on how you set up your while. It all comes down to the condition you put in while(condition) {}.
I don't see why it wouldn't work with while.
You have in a previous example
while ( x < 26;)
{
System.out.print(correct[x]);
} now, if you don't increase x, it will always be smaller than 26

. So next time:
while ( x < 26;)
{
System.out.print(correct[x]);
x++;
}