Oct 4, 2024
main
function.println
function to print to console.var
(mutable) or val
(immutable).var age: Int = 25
Int
, Double
, String
, Boolean
, Char
.toDouble
, toInt
).+
, -
, *
, /
, ==
, !=
, &&
, ||
.if
and else
statements for branching logic.for
, while
, do-while
loops for iteration.break
and continue
to control loop execution.arrayOf
function.mutableListOf
) and immutable (listOf
) lists.var
and val
to declare properties.class Car(val model: String, var speed: Int)
open
keyword to make classes inheritable.override
keyword to override methods in inherited classes.interface
keyword and must implement its methods.<T>
and specify type constraints with : T
.suspend
functions and launch
builder.fun
keyword outside class declaration.NullPointerExceptions
.