You’re nearly there! Now, you can create classes right and left, with a side-serving of init blocks and two secondary constructors for dessert. In this lesson, you learned:
A primary constructor is defined in the class’s header and always executes first.
A secondary constructor always goes last in the initialization. The initializer blocks kick in before it. There can be many secondary constructors.
Initializer blocks are literally blocks of code that are executed during initialization.
Object is an ambiguous term usually used for describing instances of a class, but in Kotlin, it’s also the special class type that implements the Singleton pattern natively.
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: Quiz: Construct Class Instances
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.