So I'm pretty new to Java and this is my first semester. Can anybody help me out and tell me what I'm getting wrong here in my "okUserName() method"? I keep trying to work on it but I'm definitely stumped. Also I have an alternate driver class with a main method & a file in the same folder, but everything is perfect there.
*mind the awful indentation I just copy and pasted from my ide.
Please, please, please post your code in code tags.
I believe the problem with your okUserName() method is that you have a return statement in an if clause (or in if clauses). When the compiler sees this, it assumes it is possible that the if clauses will never be executed so that a return may never occur, causing the error, method x() must return <something>. A way to correct this is with an else statement:
That way the compiler will see there will always be a value returned.
Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795