我试图了解kotlin中以下两段代码之间的区别:
myVar?.let { print(it) } ?: run { print("its null folks") }
Run Code Online (Sandbox Code Playgroud)
VS
myVar?.let { print(it) } ?: print("its null folks")
Run Code Online (Sandbox Code Playgroud)
他们相同吗?运行只是为了我们可以使用一个代码块而另一个只用于一个语句?
| 归档时间: |
|
| 查看次数: |
325 次 |
| 最近记录: |