Skip to content

Commit 53b7464

Browse files
authored
修正原书中的错误
1 parent a9f4b2c commit 53b7464

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ch02/07_Wildcard_Capture.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
```java
1111
public static void reverse(List<?> list);
12-
public static void <T> reverse(List<T> list);
12+
public static <T> void reverse(List<T> list);
1313
```
1414

1515
通配符签名稍短且更清晰,是类库中使用的签名。如果使用第二个签名,则很容易实现该方法:
1616

1717
```java
18-
public static void <T> reverse(List<T> list) {
18+
public static <T> void reverse(List<T> list) {
1919
List<T> tmp = new ArrayList<T>(list);
2020
for (int i = 0; i < list.size(); i++) {
2121
list.set(i, tmp.get(list.size()-i-1));

0 commit comments

Comments
 (0)