Kotlin Professional Certificate study materials
Kotlin Professional Certificate study resources

Kotlin Professional Certificate key terms

Kotlin Professional Certificate · Get comfortable with the vocabulary.

val

Declares a read-only reference: the variable cannot be reassigned after initialization, though the object it points to may still be mutable. Preferred default in Kotlin code.

Related: var, immutability
var

Declares a mutable reference that can be reassigned to a new value. Use only when reassignment is genuinely needed; the compiler warns about unnecessary use.

Related: val
Null safety

The type system distinguishes nullable types (String?) from non-nullable ones (String). Nullable values must be handled via safe calls, Elvis operator, or explicit checks before use.

Related: Safe call operator, Elvis operator, Smart cast
Safe call operator

The ?. operator performs a call only when the receiver is non-null, otherwise returning null. Chains short-circuit, so a?.b?.c never throws for null links.

Related: Elvis operator, Null safety
Elvis operator

The ?: operator returns the left operand if it is non-null, otherwise evaluates and returns the right operand. Commonly supplies defaults or triggers early return via ?: return.

Related: Safe call operator, Null safety
Smart cast

After a null check or type check, the compiler automatically treats a value as the narrower type within that scope. Fails for mutable properties unless they are local or val.

Related: Null safety, Type check operator
Type check operator

The is and !is operators test whether a value is an instance of a type, enabling a smart cast in the following branch. Replaces Java's instanceof.

Related: Smart cast, Type cast operator
Type cast operator

The as operator casts a value, throwing ClassCastException on mismatch; as? performs a safe cast returning null instead of throwing. Used with is checks for safe downcasting.

Related: Type check operator, Smart cast
String template

Interpolation inside string literals: $name inserts a variable, ${expression} inserts any expression result. Eliminates most string concatenation and improves readability.

Related: Raw string
Raw string

A triple-quoted literal that keeps newlines and backslashes verbatim, with no escape processing. trimIndent and trimMargin remove common leading whitespace.

Related: String template
when expression

A branch construct that returns a value and supports constants, ranges, type checks, and arbitrary boolean conditions. Exhaustive when used as an expression over enums or sealed types.

Related: Sealed class, Smart cast
Range

An interval created with .. or until, supporting iteration and the in operator. Int ranges are efficient; downTo and step adjust direction and stride.

Related: when expression, Collections vs sequences
Function default and named arguments

Parameters may declare default values, letting callers skip them; callers may also name arguments to reorder or clarify calls. Reduces overload boilerplate significantly.

Related: Extension function, Higher-order function
Extension function

Adds a callable function to an existing type without modifying or inheriting from it. Resolved statically, so it cannot override member functions and receives the receiver as this.

Related: Extension property, Higher-order function
Extension property

Declares a property-like accessor on an existing type. Because it has no backing field, it must define get (and optionally set) explicitly rather than storing state.

Related: Extension function
Data class

A class whose primary-constructor properties automatically generate equals, hashCode, toString, copy, and componentN functions. Must have at least one parameter and cannot be abstract.

Related: Destructuring declaration, Primary constructor
Sealed class

A class whose direct subclasses are restricted to the same module and known at compile time. Enables exhaustive when expressions, making it ideal for modeling closed result hierarchies.

Related: when expression, Data class
Primary constructor

The constructor declared in the class header, defining parameters and optionally properties via val/var. Initialization logic goes in init blocks executed in declaration order.

Related: Data class, Visibility modifier
Visibility modifier

Controls access: private, protected, internal (module-wide), and public (default). Kotlin has no package-private; internal is the common module-level alternative.

Related: Primary constructor, Object declaration
Object declaration

Defines a singleton in one statement, initialized lazily on first access. Companion objects attach static-like members to a class and can implement interfaces.

Related: Visibility modifier, Extension function
Higher-order function

A function that takes functions as parameters or returns one. Enables abstraction over behavior; inline modifiers can remove lambda allocation overhead.

Related: Lambda expression, Inline function
Lambda expression

An anonymous function literal written in braces, with parameters before -> and a final expression as the return value. A trailing lambda moves outside the parentheses.

Related: Higher-order function, Inline function
Inline function

A function whose body and lambda arguments are copied into call sites by the compiler, avoiding object allocation. Needed for non-local returns and reified type parameters.

Related: Lambda expression, Reified type parameter
Reified type parameter

A generic parameter made available at runtime inside an inline function, allowing is checks and class references on T. Only valid on inline functions.

Related: Inline function
Destructuring declaration

Unpacks an object into several variables using componentN functions, as in val (a, b) = pair. Data classes and maps support this out of the box.

Related: Data class, Pair and Triple
Immutability

The practice of preferring read-only references and immutable collections so state cannot change unexpectedly. Central to safe concurrency and predictable functional transformations.

Related: val, Read-only vs mutable collections
Read-only vs mutable collections

Kotlin separates interfaces like List from MutableList. A read-only reference may still point to a mutable implementation, so it is a view guarantee, not deep immutability.

Related: Immutability, Collection transformation
Collection transformation

Operations such as map, filter, flatMap, and groupBy that build new collections from existing ones. They return new instances rather than modifying the source.

Related: Collections vs sequences, Read-only vs mutable collections
Collections vs sequences

Collection operations are eager and build intermediate lists; sequence operations are lazy and evaluated on terminal operations. Sequences win for long chains over large data.

Related: Collection transformation, Terminal operation
Terminal operation

A sequence operation such as toList, first, or count that triggers evaluation of the lazy pipeline. Without one, intermediate sequence steps never execute.

Related: Collections vs sequences
Pair and Triple

Small standard-library tuples holding two or three values. Useful for returning multiple results and for destructuring, though named data classes are clearer for public APIs.

Related: Destructuring declaration, Data class
Scope function

let, run, with, apply, and also execute a block with a receiver, differing in receiver reference (it vs this) and return value (receiver vs block result).

Related: Safe call operator, Higher-order function
Coroutine

A suspendable computation managed by the kotlinx.coroutines library. Coroutines can pause without blocking a thread, enabling scalable asynchronous and concurrent code.

Related: Suspend function, CoroutineScope, Structured concurrency
Suspend function

A function marked suspend that may pause and resume without blocking its thread. Callable only from coroutines or other suspend functions.

Related: Coroutine, CoroutineScope
CoroutineScope

Defines the lifetime and context of coroutines launched within it. Cancelling a scope cancels its children; launch and async are extension functions on it.

Related: Structured concurrency, Coroutine, Job and cancellation
Structured concurrency

A parent coroutine does not complete until all its children finish, and failure or cancellation propagates through the hierarchy. Prevents leaked background work.

Related: CoroutineScope, Job and cancellation
Job and cancellation

Every coroutine has a Job representing its lifecycle. cancel requests cooperative cancellation; suspend points check it, and CancellationException unwinds normally.

Related: CoroutineScope, Structured concurrency
Gradle Kotlin DSL

Build scripts written in Kotlin (build.gradle.kts) instead of Groovy, giving type-safe accessors, IDE completion, and compile-time checking of build configuration.

Related: Kotlin compiler plugin
Kotlin compiler plugin

An extension to the compiler that generates or transforms code, such as kotlinx.serialization or the all-open plugin. Configured through Gradle dependencies.

Related: Gradle Kotlin DSL, Annotation
Annotation

Metadata attached to declarations using @ syntax, retained at source, binary, or runtime as configured. Used for frameworks, serialization, and compiler plugins.

Related: Kotlin compiler plugin
kotlin.test

The multiplatform testing library providing assertions like assertEquals and annotations such as @Test. Backed at runtime by JUnit, TestNG, or other frameworks.

Related: Test fixture and lifecycle, Assertion
Assertion

A statement that verifies an expected outcome in a test, such as assertEquals or assertFailsWith. A failed assertion aborts the test and reports the mismatch.

Related: kotlin.test, Test fixture and lifecycle
Test fixture and lifecycle

Setup and teardown hooks (@BeforeTest, @AfterTest) that prepare shared state around each test. Ordering and isolation matter for reliable, repeatable results.

Related: kotlin.test, Assertion