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.

data types

Byte
8 bits
var byteVar: Byte
Char
8 bits
var charVar: Char
Short
16 bits
var shortVar: Short
Int
32 bits
var intVar: Int
Long
64 bits
var longVar: Long
Float
32 bits
var floatVar: Float
Double
64 bits
var doubleVar: Double
String
16 bits
var StringVar: String

define var and class useage

Create Variable
var [varNa­me]­:[v­arType]
Create Const
val [varNa­me]­:[v­arT­ype­]=[­Value]
Create Class
val invoice = Invoice()
Define Variable Type With Value
var [varNa­me]­="Hello, World!­"