In Kotlin, every class is
finalby default. You must explicitly use the keyword
open, which is the exact opposite of Java’s
final, to allow the class to be capable of inheritance. This prevents the creation of non-final classes that are not consciously designed for inheritance.
In Kotlin, you can simply use data classes instead, where the compiler automatically derives methods like
hashCode() and many more. This is possible because the standard functionality can be mechanically derived from the propertie…