这样的代码也许你看起来很容易,可我看着不容易呢!
public class IntegerDemo {
public static void main(String[] args) {
Integer i = new Integer(100);
Integer ii = 100;
ii = ii + 200;
ii = new Integer(ii.intValue()+200);
System.out.println(ii);
Integer i = null;
NullPointerException
i = i + 100
i = i.intValue() + 100
if (i != null) {
i += 100;
System.out.println(i);
}
i += 100;
}
} |
|