|
蓝森林 http://www.lslnet.com 2006年6月6日 10:18
.intValue()是自动调用吗???
小弟是个新手 刚才在编程的时候用了个语句
Integer a = (Integer)e.nextElement();
sum+= a.intValue();
我后来经过试验发现
int a = (Integer)e.nextElement();
sum+=a;
跟上面的句子得到一样的结果
是.intValue()在第3句赋值的时候自动被调用了吗?
那么前一句化的好处在哪呢?
请大哥们帮忙解释一下!! |
| |