October 2019
Intermediate to advanced
434 pages
11h 54m
English
How to best work with, and eliminate, null from Kotlin is a very relevant and important topic, and the presence of non-null types is one of the biggest differences between Java and Kotlin. Having some discussion around this key distinction is important key to learning Kotlin and understanding further concepts around null-safe calls, scoping operators, and so on. Before learning more about working with null, let's look at how we would define a non-null value. In the following snippet, you'll see we create a variable named language of the String type:
fun main(args: Array<String>) { var language: String = "Kotlin"}
If we want to assign a null value to our language variable, we will get a compiler error:
fun ...Read now
Unlock full access