Arrays.toString()
打印數組的方法,小地方,卻老忘記,來自FindBugs的提示:
The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array.
Arrays提供一系列接收不同類型數組作為參數的toString方法
The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable String that gives the contents of the array.
Arrays提供一系列接收不同類型數組作為參數的toString方法
String[] array = new String[]{"a","b","c"};
System.out.println(Arrays.toString(array));
System.out.println(Arrays.toString(array));
posted on 2009-08-17 15:17 cerulean 閱讀(1180) 評論(0) 編輯 收藏 所屬分類: Java