Kotlin Kotlin for Java Developers Quick Facts


Example

  • Kotlin does not need ; to end statements
  • Kotlin is null-safe
  • Kotlin is 100% Java interoperable
  • Kotlin has no primitives (but optimizes their object counterparts for the JVM, if possible)
  • Kotlin classes have properties, not fields
  • Kotlin offers data classes with auto-generated equals/hashCode methods and field accessors
  • Kotlin only has runtime Exceptions, no checked Exceptions
  • Kotlin has no new keyword. Creating objects is done just by calling the constructor like any other method.
  • Kotlin supports (limited) operator overloading. For example, accessing a value of a map can be written like: val a = someMap["key"]
  • Kotlin can not only be compiled to byte code for the JVM, but also into Java Script, enabling you to write both backend and frontend code in Kotlin
  • Kotlin is fully compatible with Java 6, which is especially interesting in regards for support of (not so) old Android devices
  • Kotlin is an officially supported language for Android development
  • Kotlin's collections have built-in disctinction between mutable and immutable collections.
  • Kotlin supports Coroutines (experimental)