diff --git a/demo1/InitAndSingleton.ky b/demo1/InitAndSingleton.ky new file mode 100644 index 0000000..9f09432 --- /dev/null +++ b/demo1/InitAndSingleton.ky @@ -0,0 +1,13 @@ +class InitAndSingleton{ + //初始化 + init{ + println("init") + } + //定义静态方法 + companion object{ + //方法实现 + fun function(){ + + } + } +} \ No newline at end of file