![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
kotlin
Hana_one
这个作者很懒,什么都没留下…
展开
-
Kotlin 中 object 关键字用法
Kotlin中的类和对象的工作方式与大多数面向对象语言中的相同:通常,定义一个类,然后创建该类的多个实例:import java.util.Randomclass LuckDispatcher { //1 fun getNumber() { //2 var objRandom = Random() println(objRandom.nex...原创 2019-01-24 15:04:17 · 1258 阅读 · 0 评论 -
Kotlin 标准库中run、let、also、apply、with函数的用法和区别
run 函数定义:inline fun <R> run(block: () -> R): R //1Calls the specified function block and returns its result.inline fun <T, R> T.run(block: T.() -> R): R //2Calls th...原创 2019-01-16 12:21:39 · 602 阅读 · 0 评论