Show Menu
Cheatography

Kotlin Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Comments

Multiple Line Comment
/* Multiple 
Line
Comment
*/
Single Line Comment
// Single Line Comment
Unlike Java, Kotlin comments can be nested (A comment inside another)
 

Variables

Mutable
var a: Int = 5
Immutable
val a: Int = 5
, read only
must be initia­lized (const­ruc­tor...)
Inferred
var a = 5

val a = 5
Optionals
var a: Int?

Must be initia­lized in constr­uctor
Getter And Setter
var a: Int