The basic building blocks of object-oriented programming are custom types you define to model the data your app uses. Traditional types like String and Int are limited in what they can represent and don’t fit to model complex data types. You can think of custom types as templates that you can create to represent different kinds of data in your app. For instance, you might have a “Person” type with properties such as name, age, and address. This “Person” type is your custom type, and it models the data related to a person. Kotlin provides us with classes that we use to define custom types.
In this lesson, you’ll -
Define a MuseumObject type with properties and a method.
Instantiate objects and learn how to use them.
Look at hiding one of the MuseumObject’s properties by making it private.
Then you will be able to:
Identify classes and objects in Kotlin programming language
Describe the concept of encapsulation and data hiding
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!
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.