August 2017
Intermediate to advanced
440 pages
10h
English
In Kotlin, everything is an object (reference type, not primitive type). We don't find primitive types, like the ones we can use in Java. This reduces code complexity. We can call methods and properties on any variable. For example, this is how we can convert the Int variable to a Char:
var code: Int = 75
code.toChar()
Usually (whenever it is possible), under the hood types such as Int, Long, or Char are optimized (stored as primitive types) but we can still call methods on them as on any other objects.
By default, the Java platform stores numbers as JVM primitive types, but when a nullable number reference (for example, Int?), is needed or generics are involved, Java uses boxed representation. Boxing means wrapping ...
Read now
Unlock full access