Skip to content

Commit

Permalink
Merge pull request #2290 from FengHaoJ/main
Browse files Browse the repository at this point in the history
Update java-collection-questions-01.md
  • Loading branch information
Snailclimb authored Mar 1, 2024
2 parents 3d038ad + b913150 commit 1b6635a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/java/collection/java-collection-questions-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public interface RandomAccess {

查看源码我们发现实际上 `RandomAccess` 接口中什么都没有定义。所以,在我看来 `RandomAccess` 接口不过是一个标识罢了。标识什么? 标识实现这个接口的类具有随机访问功能。

`binarySearch)` 方法中,它要判断传入的 list 是否 `RandomAccess` 的实例,如果是,调用`indexedBinarySearch()`方法,如果不是,那么调用`iteratorBinarySearch()`方法
`binarySearch()` 方法中,它要判断传入的 list 是否 `RandomAccess` 的实例,如果是,调用`indexedBinarySearch()`方法,如果不是,那么调用`iteratorBinarySearch()`方法

```java
public static <T>
Expand Down

0 comments on commit 1b6635a

Please sign in to comment.