1. Home
  2. /
  3. Kotlin
  4. /
  5. Map Operations Example

Map Operations Example - Kotlin Typing CST Test

Loading…

Map Operations Example — Kotlin Code

Demonstrates map creation, iteration, and access in Kotlin.

fun main() {
	val ages = mapOf("Alice" to 25, "Bob" to 30)
	for ((name, age) in ages) {
		println("$name is $age years old")
	}
}

Kotlin Language Guide

Kotlin is a modern, statically typed programming language designed to improve developer productivity, safety, and interoperability, offering concise syntax, null-safety, coroutines, and seamless integration with the JVM, Android, and multiplatform ecosystems.

Primary Use Cases

  • ▸Android application development
  • ▸Backend APIs with Ktor or Spring Boot
  • ▸Kotlin Multiplatform (KMP) shared logic
  • ▸Desktop apps with Compose Multiplatform
  • ▸Scripting and automation on JVM
  • ▸Building DSLs and developer tooling

Notable Features

  • ▸Null-safety and type inference
  • ▸Coroutines for structured concurrency
  • ▸Extension functions and DSL builders
  • ▸Interoperability with Java
  • ▸Kotlin Multiplatform compilation
  • ▸Concise, expressive syntax

Origin & Creator

Created by JetBrains under the leadership of Dmitry Jemerov and Andrey Breslav. Announced in 2011 and open sourced in 2012. Officially backed by Google as the preferred language for Android in 2019. Evolved with coroutines, multiplatform support, KMM, inline classes, compiler optimizations, and modern functional features.

Industrial Note

Kotlin dominates modern Android development and is rapidly expanding into backend services (Ktor, Spring), multiplatform shared logic, DSL-based tooling, and enterprise JVM applications at companies like Google, Netflix, Amazon, Uber, Trello, and JetBrains.

More Kotlin Typing Exercises

Kotlin Theme Toggle and CounterKotlin Basic Class ExampleKotlin List IterationKotlin Nullable Types ExampleKotlin Data Class ExampleKotlin When ExpressionKotlin Extension Function ExampleKotlin Lambda ExampleKotlin Simple Timer Simulation

Practice Other Languages

CReactPythonC++RustTypeScriptPHPJavaC#RubyMqlCqlN1qlCypherGremlin