- public static void main(String []args){
- int x = 10;
- method(x);
- int[] arr[] = {{1,2,3},{1,2,3}};
- int [] arr1 = {1,2,3};
- method(arr);
- method(arr1);
- System.out.println(x+arr[0][0]);
- System.out.println(x+arr1[0]);
- }
- public static void method(int x) {
- x=5;
- }
- public static void method(int[][] arr) {
- arr[0] = new int[]{5,10,15};
- }
- public static void method(int[] arr1) {
- arr1[0] = 5;
- }
复制代码 求教,为什么会出现这样子的结果 |
|