Created
January 3, 2018 07:16
-
-
Save mahata/ff5b40b4a2c9da1a15a0473ce8fc3606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass { | |
val myValue = 42 | |
companion object Factory { | |
fun create(): MyClass = MyClass() | |
} | |
} | |
public fun main(args: Array<String>) { | |
val myClass = MyClass.create() | |
println(myClass.myValue) // 42 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment