An ordered set of instructions. It reads input, follows rules, and produces output.
Workspace
Kotlin
Android apps backend services and concise JVM development
Definition first
What Kotlin means
Kotlin is a programming language for writing exact instructions, often used for Android apps backend services and concise JVM development. Start with one mental model: input goes through steps and becomes output.
Main.ktRun kotlinc Main.kt -include-runtime -d app.jar && java -jar app.jarHabit Lean on null safety and small functions before class designA value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
Kotlin compiler is the place that actually runs code from Main.kt.
First readable code
Program output
entry point output syntax printlnprintln(42)
Output 42Language lineage
Kotlin family tree
See where Kotlin comes from, which languages feel close, and what to learn next.
Zero base path
Question bank
Search before practice
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
Kotlin practice 1
Kotlin question 1. Choose the statement that matches printing a value.
Kotlin practice 2
Kotlin question 2. Choose the statement that matches naming a value.
Kotlin practice 3
Kotlin question 3. Choose the statement that matches reusable function.
Kotlin practice 4
Kotlin question 4. Choose the statement that matches basic collection.
Kotlin practice 5
Kotlin question 5. Choose the statement that matches printing a value.
Kotlin practice 6
Kotlin question 6. Choose the statement that matches naming a value.
Kotlin practice 7
Kotlin question 7. Choose the statement that matches reusable function.
Kotlin practice 8
Kotlin question 8. Choose the statement that matches basic collection.
Kotlin practice 9
Kotlin question 9. Choose the statement that matches printing a value.
Kotlin practice 10
Kotlin question 10. Choose the statement that matches naming a value.
Kotlin practice 11
Kotlin question 11. Choose the statement that matches reusable function.
Kotlin practice 12
Kotlin question 12. Choose the statement that matches basic collection.
Kotlin practice 13
Kotlin question 13. Choose the statement that matches printing a value.
Kotlin practice 14
Kotlin question 14. Choose the statement that matches naming a value.
Kotlin practice 15
Kotlin question 15. Choose the statement that matches reusable function.
Kotlin practice 16
Kotlin question 16. Choose the statement that matches basic collection.
Kotlin practice 17
Kotlin question 17. Choose the statement that matches printing a value.
Kotlin practice 18
Kotlin question 18. Choose the statement that matches naming a value.
Multiple choice
Kotlin practice 1
Kotlin question 1. Choose the statement that matches printing a value.
println(42)
Reference
Patterns for Main.kt
kotlinc Main.kt -include-runtime -d app.jar && java -jar app.jarentry point output syntax println
Program output
println(42)
- Run the smallest file first
- Print one known value
- Check the output before adding more code
variables assignment types val
Values and names
val total = 42 println(total)
- Give values readable names
- Keep one idea per line while learning
- Trace the value before changing it
function collection List
Functions and collections
fun add(a: Int, b: Int): Int {
return a + b
}
val scores = listOf(40, 2)
println(scores.size)- Keep functions small
- Return useful values
- Use the common collection before reaching for frameworks