kotlin check if variable has been defined code example Example: kotlin var init check lateinit var file: File if (this::file.isInitialized) { ... }