搜尋此網誌

2019年8月7日 星期三

Array與Collection的轉換方法

印出Array所有元素
Arrays.toString()


Array轉換為List
Arrays.asList()


Arrays排序
Arrays.sort()


List轉為Array
new ArrayList().toArray()


List排序
Collections.sort()


List反轉
Collections.reverse()

沒有留言:

張貼留言