Recent Posts

Sealed class in Kotlin

1 minute read

To constrain a class hierarchy, we have to declare the superclass sealed. Without the constraint, our code will look like this:

Downcasting

1 minute read

Downcasting is to discover the specific type of a previously upcast object. Upcast is always safe because the base class cannot have a bigger interface than ...

Composition

2 minute read

One of most compelling arguments for object oriented programming is code reuse.