| 发表于:2007-01-12 12:39:472楼 得分:5 |
因为这个是int类型的值赋予,而非对象类型的引用赋予。 如果程序改为: public class test { public static void main(string[] args) { int a=99; a=oper(a); system.out.print(a); } static int oper(int b){ b=b+100; return b; } } 则输出是199。 但如果a是对象类型的(例如string类型)则赋予的是一个引用。值会改变了。 | | |
|