Here is some source code for the Boolean class in java.
public Boolean(String s) {
this(toBoolean(s));
}
public static boolean parseBoolean(String s) {
return toBoolean(s);
}
private static boolean toBoolean(String name) {
return ((name != null) && name.equalsIgnoreCase("true"));
}
So, as you can see, you need to pass a string with the value "true" so that the boolean value is true. Otherwise, this is not true.
assert new Boolean( "ok" ) == false;
assert new Boolean( "True" ) == true;
assert new Boolean( "false" ) == false;
assert Boolean.parseBoolean( "ok" ) == false;
assert Boolean.parseBoolean( "True" ) == true;
assert Boolean.parseBoolean( "false" ) == false;
source
share