public class diyiti
{
public static void main(String[] args)
{
int[] it={1,2,3};
char[] ch={'c','b','a'};
String[] str={"ad","ab"};
System.out.println(ch);
System.out.println(str);
System.out.println(it+"\n"+ch+"\n"+str);
}
}
运行结果为:
cba
[Ljava.lang.String;@3e0ebb
[I@39443f
[C@1afae45
[Ljava.lang.String;@3e0ebb
为什么打印System.out.println(ch);,数组名称,能将数组内容打印出来,而不是数组地址?
|
|