In Java, the "==" operator compares if two object references point to the same object. This is one of the weird things you have to get used to in Java. Every variable (with the exception of primitive data types) stores a memory address to an object that you have created. This means that you can have two variables pointing to the same memory address, or in other words, the exact same object. That is what the "==" operator does in Java. It checks if two variables store the exact same reference. Since 'x' is a char, which is a primitive data type, you can't compare it to another object with the "==" operator, because it can't point to any memory address, unlike object references. You should be using the String.equals(anotherString) method. The API documentation for the String class can be found
here.
Here is an example of how to compare strings in Java.
[edit]
Actually, it looks like you want to compare the first character in the gender string. You can get the first character by doing String.charAt(0).
Example:
while (gender.charAt(0) != 'x')
{
}
Here is some documentation on the charAt method.
[edit edit]
Looking at your code, I don't think it will work the way you want it to. If the gender and score are stored on the same line, then gender = inFile.nextLine(); will read the whole line, including the score, and put it into gender. That means that gpa = inFile.nextDouble(); would throw an exception because inFile would be on the next line, and the line starts with a character, not a double. What you should do instead is gender = inFile.next();, which will read the current line and store the text in gender until it comes across white space (a space, new line, or tab). Then gpa = inFile.nextDouble(); will read the next double, which will be the score right after the gender in the text file.
Note that if the this is only a problem if the file is stored like:
f 3.8
m 3.7
If the file is stored like this:
f
3.8
m
3.7
Then you don't have to worry about what I just said.