June 2018
Intermediate to advanced
310 pages
6h 32m
English
To declare a class, we use a class keyword, exactly like in Java:
class Player {}
There's no new keyword in Kotlin. The instantiation of a class simply looks like this:
// Kotlin figured out you want to create a new playerval p = Player()
If the class has no body, as in this simple example, we can omit the curly brackets:
class Player // Totally fine
Read now
Unlock full access