Back to course overview

Hi and welcome to our second coding lesson.

In this lesson we will learn about Variables, Data Types, Immutability, and how to get User Input into our Application.

Here is the video to follow along:

Video

fun main ( ) { println ( "Hello Variables!" ) val myNumber = 12 val myLongNumber = 12L val myFloatingDouble = 12.34 val myFloat = 12.34f val divisionResult = 6 / 4 val divisionResultDouble = 6 / 4 . toDouble ( ) val myCharacter = 'M' val myString = "My Name is Marcus" val willWeLearnKotlin = true val firstName = "Marcus" val lastName = "Eisele" var myAgeYears = 33 println ( "Hello $firstName $lastName ! You are $myAgeYears years old. You will learn Kotlin today: $willWeLearnKotlin " ) myAgeYears = 34 println ( "Hello $firstName ! Happy Birthday! You are now $myAgeYears old" ) println ( "Hey you! Please insert your own name:" ) val ownName = readLine ( ) println ( "Hi $ownName !" ) }

If you have any further questions, leave a comment either here on the Blog, on the Youtube-Video or join the Discord Community.