java数组
程序代码:
public class liu { public static void main(String args[]){ int [] a = {10,20,30,40},b[] = {{1,2},{4,5,6,7}}; b[0] = a; b[0][1] = b[1][3]; System.out.println(a[1]); } }
输出:7
为什么a[1]=b[0][1]呢?
“数组的数组”是什么意思呢?
public class liu { public static void main(String args[]){ int [] a = {10,20,30,40},b[] = {{1,2},{4,5,6,7}}; b[0] = a; b[0][1] = b[1][3]; System.out.println(a[1]); } }