Slide 7
Slide 7 text
2: Use inheritance only when
it's needed
• In Java everything is open by default, unless
you add the keyword final
• In Kotlin everything is closed by default,
unless you add the keyword open
• Prefer composition when it's possible
• A data class cannot be open
• Inheritance breaks equality