API Interface

Learn how to write interfaces that perform HTTP operations to consume data from REST APIs.

Interfaces in architectures

Interfaces are blueprints of a class. In MVVM architecture, interfaces provide 100% abstraction since they only provide method signatures and fields without actual implementation. This serves as a contract between a programmer and the program they’re working with: all methods defined must be implemented.

Interfaces in Kotlin and Java 8 can have both abstract and non-abstract methods that can be implemented. However, non-abstract properties aren’t permitted.

Let’s look at an example.

Get hands-on with 1200+ tech skills courses.