page =
url = https://kotlinlang.org
kotlin programming language
Open in Playground →
Target platform: JVM Running on kotlin v.1.6.0
class Greeter(val name: String) { fun greet() { println("Hello, $name") } } fun main(args: Array<String>) { Greeter(args[0]).greet() }
import kotlinx.coroutines.* //sampleStart suspend fun main() = coroutineScope { for (i in 0 until 10) { launch { delay(1000L - i * 10) print("$i ") } } } //sampleEnd
/* Create a POJO with getters, `equals()`, `hashCode()`, `toString()` and `copy()` in a single line: */ data class Customer(val name: String, val email: String, val company: String) // Or filter a list using a lambda expression: val positiveNumbers = list.filter { it > 0 } // Want a singleton? Create an object: object ThisIsASingleton { val companyName: String = "JetBrains" }