public class Other {
public static void main(String[] args) {
int[] num = new int[]{1,2};
int a = 1;
String s = new String("abc");
method(a,num,s);
System.out.println(a);
System.out.println(num[1]);
System.out.println(s);
}
public static void method( int a,int[] x, String s){
a = 2;
x[1] = 50;
s = "abcd";
}
}
数组的数值会被改变,字符串不会,请问一下整个过程堆栈操作原理。 |
|