Topic 1 - Introduction to Kotlin


What is Kotlin?


Some Kotlin features


Hello World in Kotlin


Variables example


Loops in Kotlin


Conditional statements in Kotlin


Conditional expressions


Basic arrays, including for-in and if-in


Nullability


Non-nullable variables


Nullable variables


The safe-access operator


A practical example, and introducing Elvis


Functions in Kotlin


Classes and Objects in Kotlin


Making our class more concise - automatically setting constructor parameters equal to class attributes


Data classes - concisely representing complex data structures


Introducing some more Kotlin collections


The List


Creating a Mutable List


More on Functions in Kotlin


Anonymous Functions


Passing functions as arguments to other functions


Lambda functions


Making the lambda more concise - I


Making the lambda more concise - II - the implicit "it"


Real-world use of lambdas


Question

Further reading

I have prepared some notes on additional basic Kotlin topics, including inheritance and map data structures. We may be able to cover these at the start of the lab session. If not, please read the notes here.