1,看Boolean的Source code, getBoolean的意思是去取系统变量中的这个name的变量是否为"true"
public static boolean getBoolean(String name) {
        boolean result = false;
        try {
            result = toBoolean(System.getProperty(name));
        } catch (IllegalArgumentException e) {
        } catch (NullPointerException e) {
        }
        return result;
    }
    private static boolean toBoolean(String name) { 
return ((name != null) && name.equalsIgnoreCase("true"));
    }2,应该是不会这样的,你把你的代码贴出来看看

解决方案 »

  1.   

    getBoolean
    public static boolean getBoolean(String name)Returns true if and only if the system property named by the argument exists and is equal to the string "true". (Beginning with version 1.0.2 of the JavaTM platform, the test of this string is case insensitive.) A system property is accessible through getProperty, a method defined by the System class. 
    If there is no property with the specified name, or if the specified name is empty or null, then false is returned. 
    Parameters:
    name - the system property name. 
    Returns:
    the boolean value of the system property.
      

  2.   

    第2个问题是这样的,我要通过读数据库来选择是否在setselected ,问题是我第一次读,是要求选择了,第2次读却没有选择上,那我就应该让setSelected(false),问题是第二次就是不行,我用isSelected()查了,依然是true ,我应该如何实现呢?