· 3 min read

Kotlin Essentials Flashcards: Null Safety, Scope Functions and the Cards to Add

Study Kotlin with 42 flashcards: val vs var, final-by-default classes, Elvis and safe-call operators, scope functions, plus the coroutine cards the deck misses.

Kotlin-style geometric triangle beside a lighthouse island and floating flashcards

Studying. But it's also a video game. 🎮

Flashcards, quizzes and games that make you actually remember.

Start playing — it's free

Posted by

Most Kotlin flashcard decks are cheat sheets of syntax. Deck OA9580 — Kotlin Essentials is different: its 42 cards read like a condensed encyclopedia entry, with prose backs instead of code. That makes it excellent for explaining why Kotlin looks the way it does, and thin on what you will type every day. Here is how to use it well, and the cards you should add.

Study this deck: Kotlin Essentials

1 / 10
Question

Kotlin

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

What the deck actually asks

FrontBack
What keyword declares an immutable variable?val
Are Kotlin classes open for inheritance by default?No, all classes are public and final by default
internal visibility modifierVisible within a module
Elvis operator?: returns the first operand if non-null, else the second
Safe navigation operator?. returns null if the object is null
How many scope functions does Kotlin have?Five: let, run, with, apply, also
Data classAuto-generated equals, hashCode and toString
Origin of the name "Kotlin"Kotlin Island, in the Gulf of Finland near Saint Petersburg

The four blocks inside the 42 cards

  • Identity and history (cards 1-3, 29-35): cross-platform statically typed language, type inference, full Java interop, Kotlin/JVM, Kotlin/JS, Kotlin/Native via LLVM, Kotlin Multiplatform, Compose Multiplatform, Ktor, the influence of C#, Eiffel, Gosu, Groovy, ML and Scala, "compile as quickly as Java".
  • Declarations and syntax (4-16, 36): optional semicolons, type after the colon (name: String), var vs val, fun, main without parameters since Kotlin 1.3, $name string interpolation.
  • Classes and visibility (8-13, 22-23, 40-41): final-by-default, open, abstract classes, public/internal/protected/private, sealed classes, data classes, primary constructors that declare properties.
  • Functional and null-safety features (17-28, 39, 42): extension functions, scope functions, spread operator *, destructuring for ((key, value) in map), local functions, nullable ? types, lambdas { x -> ... }, default and named arguments, contracts.

Study the third and fourth blocks first: they are what interviewers and code reviews test. The history block is review material, not a priority.

Tip 1 — turn prose backs into code you can type

Every back here is a sentence. Before reviewing, add a one-line snippet to the hint of the 10 most practical cards: val city = user?.address?.city ?: "unknown" for cards 25-26, data class Point(val x: Int, val y: Int) for card 23, fun String.shout() = uppercase() + "!" for card 17. For scope functions, memorize the 2×2 grid rather than five names: let/also use it, run/apply use this; apply/also return the object, let/run return the lambda result (with is the non-extension run).

Tip 2 — write the cards the deck never mentions

There is no card on coroutines (suspend, launch, Flow), none on when, object / companion object, smart casts, the !! not-null assertion, lateinit or by lazy. Add those seven cards. Also tag two cards as dated: card 29 lists "three main compile targets" while card 3 already names WebAssembly, now a fourth target (Kotlin/Wasm); and card 22's "all subclasses defined at compile time" really means same module and package since Kotlin 1.5.

The same "Essentials" series has a code-first format worth comparing: see the Swift Essentials guide for optionals vs Kotlin nullable types, and the Go Essentials study guide if you want to see how goroutines compare to the coroutines this deck leaves out.

Find OA9580 — Kotlin Essentials in the library on Flip It.

Ready to learn faster? 🚀

Join FLIP IT for free and turn studying into a game.

Create my free account