泛型函数

泛型函数有一个泛型类型参数,该参数被指定在<>中,位于函数名称之前。

fun <T> singletonList(item: T): List<T> {}

更多信息请参考泛型。

results matching ""

    No results matching ""