一、Arrays 操作数组的工具类:
Arrays.sort(任何数组);
Arrays.binarySearch(arr,7); -----查找7, 如果没有,返回负的插入点减一。 这个方法的前提是数组已经正序拍好顺序。
Arrays.toString(arr)
二、Collections
Collections.sort(list);-------------------set 无序,不能排序
Collections.binarySearch();
Collections.shuffle(list); --------------随机排序
Collections.reverse(list); -------------翻转(StringBuffer/Builder 也有这个reverse方法)


网友评论