public class TestBooleanNull {
public static void main(String[] args) {
if (test()) {
System.out.println("1232");
}
}
/**
* java.lang.Boolean是对象,可以为null。但null作为if的条件会报npe
* @return
*/
private static Boolean test() {
return null;
}
}










