are non-null, but baz() returns null. // vice versa, return value is non-null if and only if foo(), bar() and baz() are non-null foo()?.bar()?.baz() Lambdas Kotlin provides support for higher-order functions and anonymous functions or lambdas. // the following function takes a lambda, f, and executes f passing it the string "lambda" // note that (String) -> Unit indicates a lambda with a String parameter and Unit return type fun executeLambda(f: (String) -> Unit) { f("lambda") } Lambdas are declared using braces, . If a lambda takes parameters, they are declared within the braces and followed by the operator. // the following statement defines a lambda that takes a single parameter and passes it to the println function val l = { c : Any? -> println(c) } // lambdas with no parameters may simply be defined using { } val l2 = { print("no parameters") } Complex "hello world" example fun main(args: Array<String>) { greet { to.place }.print() } // Inline higher-order functions inline fun greet(s: () -> String) : String = greeting andAnother s() // Infix functions, extensions, type inference, nullable types, // lambda expressions, labeled this, Elvis operator (?:) infix fun String.andAnother(other : Any?) = buildString() { append(this@andAnother); append(" "); append(other ?: "") } // Immutable types, delegated properties, lazy initialization, string templates val greeting by lazy { val doubleEl: String = "ll"; "he${doubleEl}o" } // Sealed classes, companion objects sealed class to { companion object { val place = "world"} } // Extensions, Unit fun String.print() = println(this) Tools IntelliJ IDEA has plug-in support for Kotlin. IntelliJ IDEA 15 was the first version to bundle the Kotlin plugin in the IntelliJ Installer, and provide Kotlin support out of the box. JetBrains also provides a plugin for Eclipse. Integration with common Java build tools is supported including Apache Maven, Apache Ant, and Gradle. Android Studio (based on IntelliJ IDEA) has official support for Kotlin, starting from Android Studio 3. Emacs has a Kotlin Mode in its MELPA package repository. Vim has a plugin maintained on GitHub. Json2Kotlin generates POJO style native Kotlin code for web service response mapping. Applications When Kotlin was announced as an official Android development language at Google I/O in May 2017, it became the third language fully supported for Android, in addition to Java and C++. As of 2020, Kotlin is still most widely used on Android, with Google estimating that 70% of