Skip to content

Instantly share code, notes, and snippets.

@droid-lover
Created March 3, 2023 12:37
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 droid-lover/4a550b66b9eb901bf9e6468d35185293 to your computer and use it in GitHub Desktop.
Save droid-lover/4a550b66b9eb901bf9e6468d35185293 to your computer and use it in GitHub Desktop.
/**
* Native Mobile Bits Evening Coding Paper @5pm IST
* lateinit in Kotlin
*/
class Main {
lateinit var name: String
fun checkValues() {
if (this::name.isInitialized){
println("Value of name is $name")
}else{
println("Value is not initialized")
}
}
}
fun main(){
val main = Main()
main.name = "Native Mobile Bits"
main.checkValues()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment