Homework 2: Simple Kotlin

Due April 5

In this assignment, you will get to play around with Kotlin programming language at a deeper level.

A generally good understanding of how debugString work will also be extremely useful for this assignment.

circle-exclamation

Prerequisites

In order to run your test script, you must ensure that the following items have been completed:

Running your test script

You can do so by executing the command kotlinc -script main.kts in your Terminal.

debugString

debugString is a read-only string. A property that is declared as read-only must use the val keyword.

Getters & Setters

It is important to be familiar with how getters and settersarrow-up-right are initialized inside a class.

Here is an example of a get() and set() method:

Last updated