May 2024
Intermediate to advanced
560 pages
16h 9m
English
This chapter covers
object keywordIn this chapter, you’ll gain a deeper understanding of working with classes and interfaces in Kotlin. You already saw the basic syntax for declaring a class in section 2.2, and you know how to declare methods and properties, use simple primary constructors (aren’t they nice?), and work with enums. But there’s a lot more to see and learn on the topic! Kotlin’s classes and interfaces differ a bit from what you might be used to from Java: for example, interfaces can contain property declarations. Kotlin’s declarations are final and public, by default. In addition, nested classes ...
Read now
Unlock full access