January 2018
Intermediate to advanced
434 pages
14h 1m
English
Now that Kotlin supports the implementation of methods in interfaces, you might be thinking what's the difference between an interface and abstract methods.
In interfaces, you can only define the property, which needs to be overridden by implementing class. However, in an abstract class, you can have an implementation that works with the state so that it cannot be overridden in the derived classes. In an abstract class, you can define some states and methods that will be the same in the derived class.
Another key difference is that you can have final members in an abstract class, but not in interfaces. Also, interfaces don't support protected and internal modifiers. It only supports private.
Read now
Unlock full access