Skip to content

Instantly share code, notes, and snippets.

@vodamiro
Created April 11, 2019 14:09
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 vodamiro/6a9520743afba03c0355d66bba73f1a1 to your computer and use it in GitHub Desktop.
Save vodamiro/6a9520743afba03c0355d66bba73f1a1 to your computer and use it in GitHub Desktop.
S_A_Constructors.kt
class InitOrderDemo(name: String) {
val firstProperty = "First property: $name".also(::println)
init {
println("First initializer block that prints ${name}")
}
val secondProperty = "Second property: ${name.length}".also(::println)
init {
println("Second initializer block that prints ${name.length}")
}
}
InitOrderDemo("hello")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment