关于JAVA中传值与传引用的问题!!!
JAVA中怎么能用传引用的方法传递参数,比如:
public class t2 {
public static void main (String [] args) {
int a = 1;
int b = 5;
operate (a,b);
System.out.println("a="+a+",b="+b);
}
static void operate (int x, int y) {
x++;
y++;
}
}
如何改这个程序来实现改变a,b值的目的。
请具体讲一下传值和传引用。
谢谢!:)