Skip to Main Content

Java APIs

Why am i getting both true and false on a boolean at the same time?

843810Jun 22 2010 — edited Jun 22 2010
Why am i getting a return of both true and false on a boolean at the same time?
This is part of my code:
switch (cStoreInput)
 {
    //case ' ': if(!isInputValid(getInputOnString())) Error.errorVarOrFunctionDoesNotExist(nRow); break;
    //case ';': if(!isInputValid(getInputOnString())) Error.errorVarOrFunctionDoesNotExist(nRow); break;
    case ' ': System.out.println(isInputValid(getInputOnString())); break;
}
private static boolean isInputValid(String strInput)
    {
        if (strInput.equals("abc"))
        {
            strValueTryingToStore = strInput;
            nCurrentState = 0;
            if (isTextValid() != null)  return true;
        }

        return false;
    }
in cmd, it says
true
false

Im pretty sure it should return true, but why is there a false? I only called that boolean function once.

btw, all of my functions are in static.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2010
Added on Jun 22 2010
2 comments
96 views