Jesseylove

导航

java Arrays.toString

对于一维数组:

String[] arrayStr = new String[]{"Java", "Node", "Python", "Ruby"};
System.out.println(Arrays.toString(arrayStr));

 Output :[Java, Node, Python, Ruby] 

对于二维数组:

String[][] arrayStr = new String[][]{{"JAVA","Node","Python"},{"C","C++","Objective-C"}};
System.out.println(Arrays.deepToString(arrStr));

  Output:[[JAVA, Node, Python], [C, C++, Objective-C]]

posted on 2017-09-21 15:16  Jesseylove  阅读(1284)  评论(0编辑  收藏  举报