Effective Kotlin: Item 20 — Prefer interfaces to abstract classes

Matthew Dolan
2 min readJul 10, 2018

As item 20 of Joshua Bloch’s excellent book Effective Java covers, interfaces in Java 8 with default methods are an incredibly powerful tool allowing you to provide implementations for some instance methods. It is easy to retrofit an existing class with an interface, and of course, a class can implement many interfaces providing a form of multiple inheritance not achievable with abstract classes.

Kotlin’s interfaces are very similar to those in Java 8, allowing the declaration of abstract methods, method…

--

--

Matthew Dolan

Matt Dolan has been eating doughnuts and developing with Android since the dark days of v1.6.