初始化和单利模式的实现

This commit is contained in:
yutou 2022-05-11 15:48:53 +08:00
parent b80201e982
commit 611a82f17b

13
demo1/InitAndSingleton.ky Normal file
View File

@ -0,0 +1,13 @@
class InitAndSingleton{
//初始化
init{
println("init")
}
//定义静态方法
companion object{
//方法实现
fun function(){
}
}
}