This is a curated index of Kotlin language fundamentals covered on this site — arrays, strings, and basic control flow. Each entry below links to a focused tutorial with working code examples. If you’re new to Kotlin, start with the Control Flow section; if you already know the syntax and just need a specific array or string operation, jump straight to it.
Getting Started
- Hello, World in Kotlin — the smallest possible Kotlin program, and where to run it.
- The Kotlin main Function — how the entry point works, including the version that takes command-line arguments.
- Loop Statements —
for,while, anddo-whileloops in Kotlin. - Ranges — using
..,until, anddownToto iterate over a sequence of values. - Error Handling with try/catch — catching and handling exceptions.
- Throwing Exceptions — raising your own exceptions with
throw. - Creating a Custom Exception — defining your own exception classes for domain-specific errors.
Arrays
Kotlin arrays are fixed-size, and the standard library gives you a dedicated type for each primitive (IntArray, ByteArray, etc.) alongside the generic Array<T>.
- Kotlin Array Example — the basics of declaring and reading from an array.
- Creating Arrays — the different ways to construct an array, including
arrayOfand the size-and-initializer constructor. - Creating Integer Arrays — using
IntArrayandintArrayOfspecifically. - Creating Byte Arrays — working with
ByteArray, useful for raw binary data. - Creating an Empty Array — initializing an array with no elements or a fixed size of zero-values.
- Getting the First Element — safely reading the first item, including the
firstOrNull()alternative. - Array Size — reading an array’s length with the
sizeproperty. - Creating a String Array — declaring an
Array<String>, Kotlin’s array type for text values.
Strings
Kotlin strings are immutable and come with template support ("$name") built into the language.
- String Operations — an overview of common string methods.
- Initializing a String — the basic ways to declare and assign a string value.
- Creating an Empty String — using
""versusString(). - Defining String Constants — using
const valfor compile-time string constants. - Finding String Length — reading a string’s
lengthproperty. - Comparing Strings — structural (
==) versus referential (===) equality for strings. - Checking If Two Strings Are Equal — a focused walkthrough of
equals()and case-insensitive comparison. - Multiline Strings — triple-quoted raw strings for multi-line text and templates.
- Printing a String —
print()versusprintln().
What’s Next
These fundamentals cover plain Kotlin. If you’re building Android UI, the modern approach is Jetpack Compose rather than XML layouts — we’re publishing a dedicated Compose state management guide soon. For now, see our Flutter Widgets Guide if you’re working cross-platform.