Avatar ·

Error "Property must be initialized or be abstract" in Kotlin: causes and solutions

Hi! I started learning Kotlin and encountered an error that I can't fix. I'm writing a simple Android app, and I have a class where I declare several variables. The compiler gives an error: "Property must be initialized or be abstract". Here's my code: ```kotlin class UserProfile { var userName: String var userAge: Int var email: String fun printInfo() { println("Name: $userName, Age: $userAge, Email: $email") } } ``` I want these properties to be declared in the class, but without initial values, because they will be filled later, for example, after loading data from the database or after user input. In Java, I could just declare fields without initialization, and they would get default values (null for String, 0 for