June 2018
Intermediate to advanced
310 pages
6h 32m
English
First, we'll look at how they're declared:
typealias PointsOfDamage = Longtypealias Meters = Int
We use a new keyword here, typealias. From now on, we can use Meters instead of plain old Int to return from our move() method. They aren't new types. The Kotlin compiler will always translate PointsOfDamage to Long during compilation. Using them provides two advantages:
Read now
Unlock full access