Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6bd94d2

Browse files
author
haohao
authored
Update README.md
1 parent 6928b65 commit 6bd94d2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,3 +939,16 @@ async {
939939
}
940940
}
941941
```
942+
### 泛型函数
943+
**Java**
944+
```java
945+
// Java 不能单独实现泛型函数
946+
```
947+
**Kotlin (Kotlin Anko)**
948+
```kotlin
949+
fun <T> singletonList(item: T): List<T> {
950+
return arrayListOf(item)
951+
}
952+
953+
val list = singletonList<String>("kotlin")
954+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /