正文
companion object 类似Java中Static,在其中定义变量,并实现单例方法同java类似
companion object {
private var instance: AdManager? = null
val getinstance: AdManager
get() {
if (null == instance) {
instance = AdManager()
}
return instance!!
}
}```
网友评论