Browsing tag:

kotlin interface example

Kotlin Interface Examples

Interface define contract for classes. An interface is similar to a class just that,¬†it’s a collection of abstract methods and variables.¬†Essentially Interfaces are one level more abstract than abstract classes. Let’s say we have an interface called Driveable. interface Driveable { fun drive() // declaring ‘abstract’ is implicit and unnecessary } we can then have […]