Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created December 29, 2020 13:06
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 PatilShreyas/db2c4eff234024d52826e974b4c54fbd to your computer and use it in GitHub Desktop.
Save PatilShreyas/db2c4eff234024d52826e974b4c54fbd to your computer and use it in GitHub Desktop.
val value by lazy {
println("Assigning a value")
10
}
fun main() {
println(value) // prints "Assigning a value 10"
println(value) // prints "10"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment