public class Test {
public static void main(String[] args) {
char[] arr = new char[] { 'a', 'b', 'c' };
System.out.println(arr);//abc
int[] arr1 = new int[] { 1, 2, 3 };
System.out.println(arr1);//[I@5fd0d5ae
double[] arr2 = new double[] { 1.1, 2.2, 3.3 };
System.out.println(arr2);//[D@2d98a335
public void println(char[] x) {
synchronized(this) {
this.print(x);
this.newLine();//在Java中println定义char型直接输出值,int。double输出地址
}
}
Java中println输出各类型数组
最新推荐文章于 2024-03-29 10:04:46 发布