相关疑难解决方法(0)

Kotlin 通用属性

kotlin 有没有办法在声明类级别泛型类型的情况下创建泛型属性?看起来像这样的东西:

interface Generic {
    val t: T //I need this type only once, thats why I dont wanna pass in the class level

    fun <E> gMethod(e: E) { //This works, so I'm wondering if there's something similiar to properties

    }
}
Run Code Online (Sandbox Code Playgroud)

kotlin

8
推荐指数
3
解决办法
4811
查看次数

标签 统计

kotlin ×1