Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications

Categories

🎓 Certifications
🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
CheatGrid
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications
LVLEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Kotlin Cheat Sheet

Kotlin Cheat Sheet

Back to Programming Languages
Updated 2026-04-29
Next Topic: Memory Management in Programming Cheat Sheet

Kotlin is a modern, statically-typed programming language developed by JetBrains that runs on the Java Virtual Machine (JVM), compiles to native binaries, and WebAssembly, and is officially supported for Android development. Since Google announced Kotlin as a first-class language for Android in 2017, it has become the preferred choice for millions of developers due to its concise syntax, null safety guarantees, and seamless Java interoperability. The K2 compiler — stable since Kotlin 2.0 — brings significantly faster compilation and unified behaviour across all platforms. Understanding Kotlin's type system and its convention-based approach (where language features like operator overloading and property delegation are implemented through specific naming conventions) is key to writing idiomatic, expressive code across Android, server-side, and Kotlin Multiplatform projects.

What This Cheat Sheet Covers

This topic spans 22 focused tables and 167 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Null Safety FeaturesTable 2: Coroutines & Async ProgrammingTable 3: Extension Functions & PropertiesTable 4: Scope FunctionsTable 5: Data Classes & Sealed HierarchiesTable 6: Collections & Functional OperationsTable 7: Lambdas & Higher-Order FunctionsTable 8: Properties & DelegationTable 9: Type System & GenericsTable 10: Control Flow & ExpressionsTable 11: Strings & TemplatesTable 12: Inline Functions & ModifiersTable 13: Destructuring & ConventionsTable 14: Sequences vs ListsTable 15: Object-Oriented FeaturesTable 16: SAM Conversions & Functional InterfacesTable 17: Interoperability AnnotationsTable 18: Advanced Type FeaturesTable 19: DSLs & Type-Safe BuildersTable 20: Kotlin ContractsTable 21: Context Parameters (Kotlin 2.2)Table 22: Kotlin Multiplatform (KMP)

Table 1: Null Safety Features

Kotlin's headline feature: the type system tracks whether a value can be null, turning a whole class of runtime crashes into compile errors. The operators here are how you work with that distinction — declaring nullable types with ?, navigating them safely with ?. and the Elvis ?:, and only resorting to the !! assertion when you're truly certain a value is present.

FeatureExampleDescription
Nullable types
var name: String? = null
• Append ? to any type to allow null values
• compiler enforces explicit handling before access.
Safe call operator
val length = name?.length
• Returns null if the receiver is null
• chains safely without throwing NullPointerException.
Elvis operator
val len = name?.length ?: 0
Provides default value when the left-hand expression evaluates to null.
Smart casts
if (x != null) x.length
Compiler automatically casts to non-nullable type after a null check — no explicit cast needed.

More in Programming Languages

  • JUnit Cheat Sheet
  • Memory Management in Programming Cheat Sheet
  • Arrays & Strings Cheat Sheet
  • Java Cheat Sheet
  • Python Libraries Cheat Sheet
  • TOML Configuration Format Cheat Sheet
View all 31 topics in Programming Languages