Skip to content

Instantly share code, notes, and snippets.

@abdurahmanadilovic
Last active January 27, 2018 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdurahmanadilovic/6dcb13d96f723f871a4acbcb01622345 to your computer and use it in GitHub Desktop.
Save abdurahmanadilovic/6dcb13d96f723f871a4acbcb01622345 to your computer and use it in GitHub Desktop.
Kotlin init block
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