指定输出数字2
int arr = new int[][]{{1,2,3},{4,5,6},{7,8,9}};
System.out.println(“结果:” + arr[0][1]);
//结果:2
char型数组可以直接输出,不用char[0]这样下标输出;
char型数组可直接输出的不是string类型的,还是’a’,字符型
= new char[10];
System.out.println(chars);//
char[] asd = {'e','s','c'};
System.out.println(asd);//esc
//将输出的char数组转化为string,String.valueOf(asd)
System.out.println(String.valueOf(asd).equals("esc"));//true
//asd是字符'e''s''c',不是"esc"
System.out.println(asd.equals("esc"));//false
char[] asd1 = {'e','s','c'};
//默认输出为esc,调用toString()则为地址
System.out.println(asd.toString());//[C@234bef66
}