Boolean.valueOf(“TRUE”)==true//此处的参数true忽略大小写
其他都是false
直接上源码:
/** * Returns a {@code Boolean} with a value represented by the * specified string. The {@code Boolean} returned represents a * true value if the string argument is not {@code null} * and is equal, ignoring case, to the string {@code "true"}. * * @param s a string. * @return the {@code Boolean} value represented by the string. */ public static Boolean valueOf(String s) { return toBoolean(s) ? TRUE : FALSE; }
private static boolean toBoolean(String name) { return ((name != null) && name.equalsIgnoreCase("true")); }