My loop keeps looping...even after the condition is changed to false. Whether I enter a "y" or an "n" my loop still loops. I know it's never leaves the loop, because I never get the "do I get here" println.
This is my first time with booleans...so maybe I'm doing something wrong.. with them.
public static void enterStudentNumber (int [] numberArray, String [] nameArray, Keyboard kbd)
{
boolean correctName = true;
char response;
int number;
while (correctName = true )
{
System.out.println("Please enter a Student Number");
number=kbd.readInt();
System.out.println("Are you refering to student: "+nameArray[number]+" Enter a 'y' or a 'n'.");
response=kbd.readChar();
if (response == 'n')
{
correctName = false;
System.out.println("i changed to false, so you better not loop");
}
}
System.out.println("do i get here");
} //endmethod