In this lesson, you’ve scratched the surface of interfaces, which enable you to model behavior that isn’t connected to inheritance.
You learned:
That interfaces offer a flexible way to define blueprints for methods, properties, and requirements, allowing your code to adapt and be more reusable.
About abstract classes and how you can define methods and properties that child classes should adopt. However, a class can only extend one class since Kotlin does not support multiple inheritance.
That, unlike traditional inheritance, classes can adopt multiple interfaces as necessary.
About the Kotlin Standard Library, which provides us interfaces such as Comparable, which you used in this lesson.
You can define your own interfaces to create reusable code that defines the data or functionality to adopt.
That properties in abstract classes can maintain state while properties in interfaces can’t.
See forum comments
This content was released on May 22 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: Demo
Next: Abstract Classes and Interfaces Quiz
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.