1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Update Arrays,CollectionsCommonMethods.md

This commit is contained in:
SnailClimb 2019-03-22 10:03:31 +08:00 committed by GitHub
parent f748cfd355
commit 19a0f088cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,6 +207,14 @@ synchronizedSet(Set<T> s) //返回指定 set 支持的同步(线程安全的
``` ```
在做算法面试题的时候,我们还可能会经常遇到对字符串排序的情况,`Arrays.sort()` 对每个字符串的特定位置进行比较,然后按照升序排序。
```java
String[] strs = { "abcdehg", "abcdefg", "abcdeag" };
Arrays.sort(strs);
System.out.println(Arrays.toString(strs));//[abcdeag, abcdefg, abcdehg]
```
### 查找 : `binarySearch()` ### 查找 : `binarySearch()`
```java ```java