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.

Kotlin Cheat Sheet Part 1

var
variable that could be changed later
val
constant value forever
var/val
: Type of it=any­thi­ng,­Rea­dLine()
ReadLi­ne(­)!!.to­"­Dat­aty­pe"()
to make it read from user any type i want
+var/val , $var/val
to print it
//single line comment
/**/ multi line comment
var.to­"­Dat­aTy­pe"
to convert data types
try{}c­atch{}
for making app not crash
if(CON­DIT­ION­){Code}
can use multiple if or elseif or else
when(v­ar)­{va­lue­->code}
else->­{code}
in value..value for in range
!in value..value for not in range
for(var in value..va­lue­){code}
for Loop
while(­con­dit­ion­){code}
while Loop
Do{cod­e}w­hil­e(c­ond­ition)
Do While Loop
continue
to not do the code
break..br­eak­@name
to break the code from working
string­,to­"­eff­ect­"
to apply effects on Strings
String­[nu­mber]
to show only the letter in that memory number
 

Kotlin Cheat Sheet Part 2