[Kotlin] java static method ์ฝํ๋ฆฐ ๋ฌธ๋ฒ
ยท
Languages/Kotlin
์๋ฐ : class Foo { public static int a() { return 1; } } ์ฝํ๋ฆฐ : class Foo { companion object { fun a() : Int = 1 } } From the docs: https://kotlinlang.org/docs/reference/object-declarations.html#companion-objects kotlinlang.org Companion Objects An object declaration inside a class can be marked with the companion keyword: class MyClass { companion object Factory { fun create(): MyClass = MyClass()..