what is `open` keyword for fields in Kotlin? [duplicate]

As you said, the open keyword allows you to override classes, when used in the class declaration. Accordingly, declaring a property as open, allows subclasses to override the property itself (e.g., redefine getter/setter). That keyword is required since in Kotlin everything is “final” by default, meaning that you can’t override it (something similar to C#, if you have experience with that).

Note that your class is implicitly declared as open since it is abstract, hence you cannot create an instance of that class directly.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)