Edit the Kotlin example below and click Run to preview expected output notes.
Kotlin Tutorial
Learn Kotlin Tutorial with a small example you can edit and run.
fun main(){
// ...
}
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
println("Welcome to Kotlin") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin TutorialKotlin HOME
Learn Kotlin HOME with a small example you can edit and run.
fun main(){
// ...
}
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
println("Welcome to Kotlin") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin HOMEKotlin Intro
Learn Kotlin Intro with a small example you can edit and run.
fun main(){
// ...
}
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
println("Welcome to Kotlin") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin IntroKotlin Get Started
Learn Kotlin Get Started with a small example you can edit and run.
fun main(){
// ...
}
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
println("Welcome to Kotlin") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin Get StartedKotlin Syntax
Learn Kotlin Syntax with a small example you can edit and run.
fun main(){
// ...
}
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
val score = 82 | Declares a variable (val = immutable, var = mutable). |
val result = if (score >= 75) "Pass" else "Fail" | Declares a variable (val = immutable, var = mutable). |
println(result) | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin SyntaxKotlin Output
Learn Kotlin Output with a small example you can edit and run.
println("Hello")
print("No newline")
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
print("Hi") | Prints output. |
print(" ") | Prints output. |
println("Kotlin") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin OutputKotlin Comments
Learn Kotlin Comments with a small example you can edit and run.
// single-line
/* multi-line */
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
/* Multi-line | Kotlin line. |
comment */ | Kotlin line. |
println("Comments don't change output") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin CommentsKotlin Variables
Learn Kotlin Variables with a small example you can edit and run.
val name: String = "Mana"
var age = 21
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
val name = "Mana" | Declares a variable (val = immutable, var = mutable). |
var level = 1 | Declares a variable (val = immutable, var = mutable). |
level += 1 | Kotlin line. |
println(" level ") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin VariablesKotlin Data Types
Learn Kotlin Data Types with a small example you can edit and run.
val n: Int = 7
val pi: Double = 3.14
val ok: Boolean = true
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
val a: Int = 10 | Declares a variable (val = immutable, var = mutable). |
val b: Double = 3.5 | Declares a variable (val = immutable, var = mutable). |
val ok: Boolean = true | Declares a variable (val = immutable, var = mutable). |
val ch: Char = 'A' | Declares a variable (val = immutable, var = mutable). |
println(", , , ") | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin Data TypesKotlin Operators
Learn Kotlin Operators with a small example you can edit and run.
val sum = a + b
val gt = a > b
val mod = a % b
Edit the Kotlin code below and click Run. The output panel shows the extracted Expected Output notes (or simple prints).
// Expected Output: line so the output panel has something to show.| Line | Meaning |
|---|---|
fun main() { | Program entry point. |
val a = 7 | Declares a variable (val = immutable, var = mutable). |
val b = 3 | Declares a variable (val = immutable, var = mutable). |
println(a + b) | Prints output. |
} | Kotlin line. |
- 1Kotlin is widely used for Android apps and JVM backends.
- 1Mixing up val vs var and mutating unexpectedly.
- 1Prefer val by default and keep functions small and clear.
- 1Edit the example and rerun to learn faster.
- 2Use readable Kotlin first; optimize later.
- 1Change one value and predict the output.
- 2Add one edge case and handle it.
- 3Explain the rule in 1 sentence.
Keywords (topic intent):
Kotlin JVM Kotlin Operators