open class in Kotlin

Because of a concern about the “fragile base class” problem, Kotlin classes and their functions are final by default.
* To allow a class to be extended it must be marked open, meaning that it’s “open to be extended”.
* To allow class functions and fields to be overridden, they must also be marked open.
* A member marked override is itself open, so it may be overridden in subclasses. If you want to prohibit re-overriding, use final.

```
open class A {
    open fun foo() = println("foo in A")
}
open class B : A() {
    final override fun foo() = println("foo in B")
}
open class C : B() { }

fun main() {
    var c = C()
    c.foo()
}
```