Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// build.gradle.kts (Kotlin DSL) — minimal Android/JVM project plugins { kotlin("jvm") version "1.9.22" application } repositories { mavenCentral() } dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") testImplementation(kotlin("test")) } application { mainClass.set("MainKt") // top-level main() lives in MainKt } tasks.test { useJUnitPlatform() } // Kotlin script (.kts) — runnable without compilation step // kotlinc -script hello.kts val items = listOf("apple", "banana", "cherry") items.forEachIndexed { index, item -> println("${index + 1}. $item") }
Result
Open