Introduction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

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
Download course materials from Github
Previous: Basics of OOP Quiz Next: Instruction