Are there constructor references in Kotlin?

后端 未结 1 585
星月不相逢
星月不相逢 2020-12-08 18:10

In Java we have the Class::new syntax for constructor references. I know, there are callable references for methods, but how about constructors? A typical use c

1条回答
  •  时光说笑
    2020-12-08 18:50

    You can get a function instance for a constructor by simply using ::ClassName, as if it were a factory function.

    0 讨论(0)
提交回复
热议问题