Which has best performance while converting String to boolean from the below options.
boolean value = new Boolean(\"true\").booleanValue();
Here is the source, looks like Tomasz beat me to answering the why:
public static Boolean valueOf(String s) {
return toBoolean(s) ? TRUE : FALSE;
}
public static boolean parseBoolean(String s) {
return toBoolean(s);
}
public Boolean(String s) {
this(toBoolean(s));
}
private static boolean toBoolean(String name) {
return ((name != null) && name.equalsIgnoreCase("true"));
}