July 2018
Intermediate to advanced
400 pages
12h 14m
English
Notice that the type definitions you specified for the playerName and experiencePoints variables are grayed out in IntelliJ. Grayed-out text indicates an element that is not required. Mouse over the String type definition, and IntelliJ will provide an explanation about why the element is not required (Figure 2.6).
Figure 2.6 Redundant type information
As you can see, Kotlin indicates that your type declaration is “redundant.” What does this mean?
Kotlin includes a feature called type inference that allows you to omit the type definition for variables that are assigned a value when they are declared. Because ...
Read now
Unlock full access