二维数组的问题
package com.studyNotes;
public class note05_shuzu {
public static void main(String[] args) {
int[] number = {1,2,3,4,5};
int[] number1 = number;
//遍历数组的方式1
for (int i:number) {
System.out.print(i+" ");
}
System.out.println();
//遍历数组的方式2
for (int i = 0; i < number1.length; i++) {
System.out.print(number1[i]+" ");
}
int[][] number2 = {number,number1};
for (int i = 0; i < number2.length; i++) {
System.out.print(number2[i]+" ");
}
}
}
为什么打印出来是地址值, 但是第一个打印出来的是数字