Kotlin
阳光男孩joe
这个作者很懒,什么都没留下…
展开
-
kotlin委托
类委托 interface Base{ fun print() } class BaseImpl(val x:Int):Base{ override fun print() { print(x) } } class Derived(b:Base):Base by b fun main(args: Array<String>) { ...原创 2018-07-10 17:21:45 · 233 阅读 · 0 评论 -
let,apply,with,run函数区别
let 默认当前对象闭包的 it 参数,返回值是函数里面最后一行,或者指定return fun testLet():Int { "testLet".let { println(it) println(it) println(it) return 1 } } apply 调用某对象的 apply 函数,在函...原创 2018-07-10 18:14:50 · 1572 阅读 · 0 评论