public class Test {
??? static class B {
??????? public int i = 0;
??????? public String s = "0";
??? }
??? public static void main(String[] args) {
??????? int i = 0;
??????? change1(i);
??????? System.out.println(i);???????????????????????? //0
??????? String a = "0";
??????? change2(a);
??????? System.out.println(a);???????????????????????? //0
??????? B b1 = new B();
??????? change3(b1);
??????? System.out.println(b1.i + "?? " + b1.s);?????? //100? 100
??????? B b2 = new B();
??????? change4(b2);
??????? System.out.println(b2.i + "?? " + b2.s);?????? //0? 0
???????
??????? int[] c1 = new int[]{0};
??????? change5(c1);
??????? System.out.println(c1[0]);???????????????????? //100
???????
??????? int[] c2 = new int[]{0};
??????? change6(c2);
??????? System.out.println(c2[0]);???????????????????? //0
??? }
??? public static void change1(int i) {
??????? i = 100;
??? }
??? public static void change2(String a) {
??????? a = "100";
??? }
??? public static void change3(B b) {
??????? b.i = 100;
??????? b.s = "100";
??? }
??? public static void change4(B b) {
??????? b = new B();
??????? b.i = 100;
??????? b.s = "100";
??? }
???
??? public static void change5(int[] c) {???????
??????? c[0] = 100;
??? }
???
??? public static void change6(int[] c) {
??????? c = new int[]{100};???????
??? }
}
?