Home / Community / FIT5046 - Week 2: Kotlin Basics and Jetpack Compose
Public

FIT5046 - Week 2: Kotlin Basics and Jetpack Compose

36 accessible of 36 cards

Card Preview

36 accessible of 36 cards

A quick, read-only look at the deck content.

Term

In Kotlin, what is the keyword for declaring a mutable variable?

Definition

var

Term

In Kotlin, what is the keyword for declaring a read-only variable?

Definition

val

Term

True or False: By default, all classes in Kotlin can be subclassed.

Definition

False, Kotlin classes are final by default.

Term

What keyword must be added to a Kotlin class to allow other classes to inherit from it?

Definition

open

Term

What is the default visibility modifier for classes and members in Kotlin?

Definition

public

Term

What modifier is used when a non-nullable mutable property will be initialized after class creation?

Definition

lateinit

Term

What are three rules for using the lateinit modifier in Kotlin?

Definition

It must be non-nullable, mutable (var), and cannot be used on primitive types.

Term

By default, are variables in Kotlin nullable or non-nullable?

Definition

Non-nullable.