我已经得到了这段代码,我也得到了它的答案,但我不明白他们是如何出来的,具体什么(x+" "+y)
部分以及changeUs(x, y)
,谁能解释一下?`x +“”+ y`和`changeUs(x,y)`的意义`
public class ChangeParam {
public static void main(String[] args) {
int x = 1;
double y = 3.4;
System.out.println(x+" "+y);
changeUs(x, y);
System.out.println(x+" "+y);
}
public static void changeUs(int x, double y) {
x = 0;
y = 0.0;
System.out.println(x +" "+y);
}
}
的答案是:
1 3.4
0 0.0
1 3.4
haleliuja @YCF_L非常感谢你 – xafierz
欢迎你@xafierz –