Browse topics
Kotlin Basics
Basic Programs
Get started with Kotlin: your first program, variables, and comments.
Basic ProgramsComments in KotlinA Kotlin example program demonstrating Comments, complete with the source code and expected sample output.BasicsDeclare Variables in KotlinLearn how to declare variables in Kotlin using var and val, with type inference, mutable, immutable and top-level variables, plus examples and output.Basic ProgramsFirst Program in KotlinA Kotlin example program demonstrating First, complete with the source code and expected sample output.basic programsKDoc Comments in KotlinKDoc is Kotlin's documentation comment format, similar to Javadoc. A Kotlin example with source code and sample output.
Related topics
Kotlin Data Types Explore Int, Float, Double, Char, Boolean, String and more, with type conversion. Kotlin Operators Arithmetic, relational, logical, assignment and Kotlin's special operators. Conditional Statements Control program flow with if, when, break, continue and return. Kotlin Input and Output Read input and print output in Kotlin, including the Scanner class. Looping & Controls Repeat work with for, while, do-while and the repeat function. Kotlin Functions Define functions with default, named and vararg parameters, single-expression, local, tailrec and infix functions.