- 论坛徽章:
- 0
|
package com.wondershow.cha6;
public class test {
static Integer intg = new Integer(30);
public static void main(String[] args) {
test m = new test();
Integer intg = new Integer(10);
Integer intg1 = new Integer(20);
int i = 0;;
System.out.println( "i=" + i + " intg=" + intg + " intg1=" + intg1);
m.method(intg,intg1,i);
System.out.println( "i=" + i + " intg=" + intg + " intg1=" + intg1);
}
public void method(Integer a, Integer b, int c){
a = new Integer(intg.intValue() + 10);
b = test.intg;
c += 10;
}
}
输出
i=0 intg=10 intg1=20
i=0 intg=10 intg1=20
我的疑问是:intg和intg1不是对象么,java中对象变量不是传引用调用的么?? |
|