我希望能够将类实例保存到公共静态变量,但我无法弄清楚如何在Kotlin中执行此操作.
class Foo { public static Foo instance; public Foo() { instance = this; } }
kotlin
kotlin ×1