Error when Convert java to kotlin in Android Studio


#1

After the java was converted to kotlin, it shows the error for the following code

internal var userNameEditText: EditText // Username EditText internal var passwordEditText: EditText // Password EditText internal var loginButton: Button // Login Button

The error is “Property must be initialized or be abstract”


#2

you defined a notnull property,you can do like this:

internal var userNameEditText: EditText?