From 611a82f17b8af2430603f2ec3677593321634af9 Mon Sep 17 00:00:00 2001 From: yutou <583819556@qq.com> Date: Wed, 11 May 2022 15:48:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=92=8C=E5=8D=95?= =?UTF-8?q?=E5=88=A9=E6=A8=A1=E5=BC=8F=E7=9A=84=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo1/InitAndSingleton.ky | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 demo1/InitAndSingleton.ky 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