Last active
January 27, 2018 06:56
-
-
Save abdurahmanadilovic/6dcb13d96f723f871a4acbcb01622345 to your computer and use it in GitHub Desktop.
Kotlin init block
This file contains hidden or 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 Person(val firstName: String){ | |
val blog = "www.codingstoic.com" | |
val city = "Sarajevo" | |
init{ | |
println("by $firstName") | |
println("inside init block") | |
println("blog is $blog and city is $city") | |
} | |
init{ | |
println("second init") | |
} | |
} | |
fun main(args: Array<String>) { | |
Person("Abdurahman") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment