from http://kotl.in/
Java
Kotlin
Optional
semicolons!
'fun' keyword
no more primitive types!
everything is an object
var & val
keywords
Java
getters &
setters
as
properties
String templates
no 'new' keyword
Singleton
JavaBeans...
too much boilerplate code
so Kotlin comes with...
data classes!
equals() / hashCode(), toString(), copy()
defined automatically!
nullable references:
safe calls:
too many safe calls?
smart cast (after explicit check) for that:
elvis operator:
!! operator:
safe casts (avoiding ClassCastException):
Java & Kotlin code in one place:
Calling Java code in Kotlin:
SAM Conversions:
Calling Kotlin code in Java:
We have scala, groovy, ceylon...
*from "Using Project Kotlin for Android" by Jake Wharton
We are still waiting for Kotlin 1.0
We are still waiting for Kotlin 1.0
"Only very brave souls are using Kotlin for production now" - Andrey Breslav (JetBrains)
Official Kotlin website:
Frameworks for Android:
https://github.com/JetBrains/anko
https://github.com/pawegio/KAndroid
Misc: