![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
kotlin
kotlin android
qq_23953793
Read the fucking source code!
展开
-
kotlin复合运算符
?. 安全调用运算符 foo?bar if (foo != null){ return foo.bar() }else{ return null } fun lengthOfStr(s:String?):Int = s.length //不能直接调用length方法 //如果增加了null检查以后,就可以直接调用s.length了,如下: fun lengthOfStr(s:...原创 2019-11-06 10:00:06 · 476 阅读 · 0 评论 -
kotlin中抽象类的初始化
抽象类 abstract class DemoAdapter<T> { // 数据集合 private lateinit var mDataList: MutableList<T> constructor(mDataList: MutableList<T>) { this.mDataList = mDataList ...原创 2019-11-06 09:27:54 · 990 阅读 · 0 评论