Java: primitive type 可以为 null

Yao Yao on July 22, 2013
Boolean b = null; 
boolean b2 = b;

System.out.println(b2); // null

所以不要以为 boolean 是非黑即白;int/Integer 等 primitive type 同理



blog comments powered by Disqus