Kotlin
Beginner
1 min read
Kotlin Compilation and Tooling
Example
// 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")
}
Related Resources
Kotlin Reference
Complete tag & property list
Kotlin How-To Guides
Step-by-step practical guides
Kotlin Exercises
Practice what you've learned
More in Kotlin