1. Home
  2. /
  3. Kotlin
  4. /
  5. List Iteration

List Iteration - Kotlin Typing CST Test

Loading…

List Iteration — Kotlin Code

Shows iterating over a list and using functional operations like map and filter.

fun main() {
	val numbers = listOf(1, 2, 3, 4, 5)
	val doubled = numbers.map { it * 2 }
	val even = numbers.filter { it % 2 == 0 }

	println("Original: $numbers")
	println("Doubled: $doubled")
	println("Even: $even")
}

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 Nullable Types ExampleKotlin Data Class ExampleKotlin When ExpressionKotlin Extension Function ExampleKotlin Lambda ExampleKotlin Simple Timer SimulationKotlin Map Operations Example

Practice Other Languages

CReactPythonC++RustTypeScriptPHPJavaC#RubyMqlCqlN1qlCypherGremlin