我在这方面做了一些搜索,但没有找到任何有用的信息。
关键是,如果字符串值为"true"或"false",则返回值应该为true。在其他所有值中,它应该为false。
我尝试了以下方法:
String value = "false";
System.out.println("test1: " + Boolean.parseBoolean(value));
System.out.println("test2: " + Boolean.valueOf(value));
System.out.println("test3: " + Boolean.getBoolean(value));
所有函数都返回了false :(
value
设为"true"
? - moxn