July 2018
Intermediate to advanced
400 pages
12h 14m
English
Kotlin has strict patterns around nullness when compared to languages like Java. This is a boon when working exclusively in Kotlin, but how is this pattern implemented? Do Kotlin’s rules still protect you when interoperating with a less strict language like Java? Think back to the printPlayerStatus function from Chapter 4.
fun printPlayerStatus(auraColor: String,
isBlessed: Boolean,
name: String,
healthStatus: String) {
...
}
printPlayerStatus takes in parameters of Kotlin types String and Boolean.
If you are calling this function from Kotlin, then the function signature is clear – auraColor, name, and healthStatus must be of type String, which is not nullable, and isBlessed ...
Read now
Unlock full access