What you will learn in Kotlin in Action, 2E
Chapter by chapter
Chapter 1: Kotlin: What and why
The chapter introduction characterizes Kotlin as a pragmatic successor to Java and shows how its uses have expanded across applications and platforms.
What you learn in chapter 1 →Chapter 2: Kotlin basics
This chapter introduction previews Kotlin basics and explains what it means to write idiomatic Kotlin.
What you learn in chapter 2 →Chapter 3: Defining and calling functions
Introduces the chapter’s focus on making Kotlin functions easier to declare and call, and on adapting Java libraries to Kotlin style.
What you learn in chapter 3 →Chapter 4: Classes, objects, and interfaces
Introduces concrete differences in Kotlin class declarations and the language features that make classes more flexible and concise.
What you learn in chapter 4 →Chapter 5: Programming with lambdas
The chapter introduces lambdas as passable chunks of code that help make Kotlin code reusable and expressive.
What you learn in chapter 5 →Chapter 6: Working with collections and sequences
Introduces functional collection processing as a common use of lambdas and previews sequences as an alternative for applying collection operations.
What you learn in chapter 6 →Chapter 7: Working with nullable values
Introduces nullable types as a Kotlin feature that improves code reliability and previews the chapter’s treatment of null values and Java interoperability.
What you learn in chapter 7 →Chapter 8: Basic types, collections, and arrays
Introduces the reliability-oriented choices in Kotlin’s type system that shape its basic types and collections.
What you learn in chapter 8 →Chapter 9: Operator overloading and other conventions
Introduces Kotlin conventions as language operations enabled by specially named functions and explains why extensions make those conventions useful for existing classes.
What you learn in chapter 9 →Chapter 10: Higher-order functions:Lambdas as parameters and return values
Introduces higher-order functions as a way to use lambdas in your own abstractions, beyond collection and standard-library functions.
What you learn in chapter 10 →Chapter 11: Generics
The chapter introduces two Kotlin generics concepts: reified type parameters and the distinction between declaration-site and use-site variance.
What you learn in chapter 11 →Chapter 12: Annotations and reflection
Introduces annotations as metadata on declarations and reflection as a way to inspect arbitrary classes at run time, using a JSON library to illustrate both.
What you learn in chapter 12 →Chapter 13: DSL construction
Introduces Kotlin DSL design and identifies lambdas with receivers as a way to give DSL code blocks their own functions, properties, and behavior.
What you learn in chapter 13 →Chapter 14: Coroutines
The introduction explains why applications need asynchronous work and identifies coroutines as Kotlin’s approach to it.
What you learn in chapter 14 →Chapter 15: Structured concurrency
This introduction explains why applications need to track coroutine lifetimes and presents structured concurrency as Kotlin’s built-in way to do so.
What you learn in chapter 15 →Chapter 16: Flows
Introduces flows as a coroutine-based way to work with sequential values over time.
What you learn in chapter 16 →Chapter 17: Flow operators
This section introduces flow operators and distinguishes operators that build a modified flow from those that collect and execute it.
What you learn in chapter 17 →Chapter 18: Error handling and testing
The introduction explains why robust concurrent Kotlin applications need graceful error handling and testing when components or external services fail.
What you learn in chapter 18 →Concepts explained in this book
- KotlinKotlin is a statically typed programming language designed to interoperate with Java and run across multiple execution environments.
- attributeAn annotation is a declaration-associated metadata construct whose availability and retention can be configured for source processing, compiled class files, or runtime access.
- lambdaA function literal is source syntax that directly expresses a function value, including its parameters and body.
- genericsA generic function is a function declared with one or more type parameters so it can operate on values of different types.
- type argumentA type argument is an argument supplied to a parameterized construct to specify a type or constrain the kinds of values it accepts.
- nullable typeA nullable type is a type whose values may include null and whose unsafe operations are restricted by the type system.
- lambda with receiverA lambda with receiver is a lambda whose function type designates one parameter as an implicit receiver, allowing the lambda body to access that receiver's members without qualification.
- extensionAn extension function is a Kotlin function defined outside a class that can be called with member-like syntax on values of an existing receiver type.
- deserializationDeserialization is the process of reconstructing objects or other in-memory data from a serialized representation.
- flowA Flow is an asynchronous stream abstraction whose values are collected over time and whose producer may be cold, executing anew for each collection.
- coroutineA coroutine is a lightweight suspendable computation that can pause its execution and resume it later without blocking its underlying thread.
- reflectionReflection is a programming capability for inspecting or interacting with program types, members, values, or metadata dynamically at runtime.
- suspending functionA suspending function is a function that can pause its execution without blocking its underlying thread and later resume from the same logical point.
- inline functionAn inline function is a Kotlin function whose body can be substituted at its call sites by the compiler and which can declare reified type parameters.
- non-nullable typeA non-nullable type is a Kotlin type whose values are not permitted to be null by the type system.
- accessor methodA property accessor is a getter or setter that defines how a Kotlin property value is read or changed.
- structured concurrencyStructured concurrency is a concurrency model that scopes concurrent tasks so their lifetimes and failures are managed through a shared parent-child hierarchy.
- KPropertyKProperty is a Kotlin reflection interface that represents a property declaration and provides access to its reflected metadata and value.
- reified type parameterA reified type parameter is an inline-function type parameter whose actual type information is available at runtime for restricted operations such as type checks and casts.
- SupervisorJobSupervisorJob is a coroutine Job implementation that prevents failure of one child coroutine from automatically cancelling its sibling coroutines.
- method invocationThe invoke method is a Kotlin function named invoke that enables instances of its containing type to be called with function-call syntax.
- function typeA function type describes the parameter types and return type of callable values.
- task cancellationTask cancellation is a request or mechanism for stopping an asynchronous or in-progress operation before it completes normally.
- collectionA collection is a container or aggregate that holds multiple elements and supports operations such as membership testing.
- overrideMethod overriding is the definition of a subclass member function that replaces an inherited implementation with the same signature.
- domain-specific languageA domain-specific language is a language designed to express operations and configurations within a particular problem domain.
- dispatcherA dispatcher is a coroutine execution-context component that determines which thread or threads execute a coroutine and where its continuations are resumed.
- read-only collection interfaceA read-only collection interface exposes collection contents and traversal operations without exposing mutation operations through that interface.
- star projectionA star projection is Kotlin syntax that represents a generic type argument whose specific type is unknown while preserving safe variance information.
- data transformationmap is a Kotlin standard-library operation that transforms each element and collects the resulting values into a new collection.
- KClassKClass is the Kotlin reflection interface that represents a Kotlin class or object and exposes its runtime declarations and metadata.
- delegated propertyA delegated property is a Kotlin property whose read or write behavior is provided by a separate delegate object.
- immutable collectionImmutability is the property that an object's state cannot change after the object is created.
- listMutableList is a Kotlin mutable collection type whose elements can be read and modified through its invariant type parameter.
- classA class is a Kotlin declaration that defines the structure and behavior of objects through members such as properties, functions, and constructors.
- type systemA type system is the set of rules a programming language uses to classify values and expressions and check their compatibility.
- launchlaunch is a kotlinx.coroutines coroutine builder that starts a coroutine whose computation does not produce a result value.
- object declarationThe object keyword is Kotlin syntax that declares a class and creates an instance of it as a single construct.
- kotlin.reflectThe Kotlin reflection API provides runtime and compile-time facilities for inspecting Kotlin declarations, types, and callable members.
- type erasureType erasure is an implementation technique in which generic type arguments are removed from compiled representations and are unavailable at run time.
- safe-call operatorThe safe-call operator `?.` conditionally invokes a method or accesses a property only when its receiver is non-null, otherwise producing null.
- sequenceA sequence is an ordered computation that produces elements, potentially lazily and without requiring all elements to be stored or computed immediately.
- superclassA base class is a class from which one or more subclasses inherit members and behavior.
- coroutine contextcoroutineContext is a compiler-provided property that exposes the context of the currently executing coroutine from a suspending function.
- operatorThe `..<` operator constructs a range that includes its lower endpoint and excludes its upper endpoint.
- coroutine scopecoroutineScope is a kotlinx.coroutines suspending function that creates a nested coroutine scope, waits for its child coroutines, and returns the block's result.
- dataclassA data class is a Kotlin class whose compiler generates value-oriented methods such as equality, hashing, string conversion, and component functions from its primary constructor properties.
- hot flowA hot flow is a stream whose emissions occur independently of whether any collector is currently subscribed and whose emitted items can be shared among multiple collectors.
- smart castA smart cast is Kotlin's compiler-supported automatic treatment of a value as a checked subtype within a valid control-flow branch.
- loopA loop is a control structure that repeatedly executes a block of code according to a condition or over a sequence of values.
- internal DSLAn internal DSL is a domain-specific language embedded in a host programming language and expressed using the host language's syntax and features.
- covarianceCovariance is a generic type relationship in which subtyping between parameterized types preserves the subtyping relationship between their type arguments.
- primary constructorA primary constructor is the constructor declared in a Kotlin class header that specifies constructor parameters and can define properties initialized from them.
- ValueSerializerValueSerializer is a JKid interface for converting a Kotlin value to JSON and converting a JSON value back to that Kotlin type.
- interopJava interoperability is the ability of Kotlin code to interact directly with Java code and libraries, including exchanging compatible string values without conversion.
- equality by valueequals is an object method that determines whether another value is equal to the receiver according to the object's equality contract.
- terminal operationA terminal operation is a sequence operation that produces a final result and triggers evaluation of the preceding transformations.
- shared flowA shared flow is a hot Kotlin Flow that broadcasts emissions to multiple collectors, with each collector receiving values only while subscribed unless replay is configured.
- functional interfaceA functional interface is an interface with exactly one abstract method, allowing it to be implemented by a function value or lambda in compatible contexts.
- companion objectA companion object is the specially designated object declaration inside a Kotlin class whose members can be accessed through the containing class name.
- contravarianceA contravariant type parameter is a generic type parameter that reverses the subtype direction of its type arguments and is restricted to in positions.
- unchecked castAn unchecked cast is a cast whose generic type compatibility cannot be verified by the compiler or runtime because the relevant type information is unavailable.
- valA read-only variable is a variable whose binding cannot be reassigned after initialization.
- suspendable computationA suspendable computation is a computation whose execution can be paused and later resumed while preserving its logical progress.
- supervisorA supervisor is a coroutine failure-isolation mechanism that defines a boundary within which child coroutine failures do not automatically cancel sibling coroutines or the supervising scope.
- delegationDelegation is a composition pattern in which one object forwards operations or property lookup to another object that provides the behavior.
- type inferenceType inference is the compiler's ability to determine expression types without requiring explicit type annotations everywhere.
- asyncasync is a coroutine builder that starts an asynchronous computation and produces a handle for obtaining its result.
- higher-order functionA higher-order function is a function that accepts functions as arguments, returns functions, or both.
- type checkingA type check is a Kotlin operation that tests whether a value has a specified runtime type.
- operator overloadingOperator overloading is a language feature that assigns custom implementations to predefined operator symbols.
- filteringFiltering is the operation of selecting or excluding items from data or a collection according to specified criteria.
- subtypingA subtyping relation specifies when one type can be used wherever another type is expected.
- futureA future is an abstraction representing a result that may become available after an asynchronous computation finishes.
- virtual timeVirtual time is a test-controlled representation of elapsed time that allows time-dependent operations to advance without waiting for real time to pass.
- receiver typeA receiver type is the class or interface type whose values can invoke an extension function or serve as the receiver for an extension function type.
- first-class objectA first-class function is a function that can be stored in variables, passed as an argument, or returned from another function.
- runTestrunTest is a kotlinx.coroutines testing function that runs coroutine-based tests with controlled virtual time and test scheduling.
- predicateA predicate function is a function that evaluates an input and returns a Boolean indicating whether it satisfies a condition.
- state flowA StateFlow is a Kotlin coroutines hot-flow implementation for communicating and observing state, retaining a current state value for collectors.
- KProperty1KProperty1 is a Kotlin reflection interface for a property whose getter takes one receiver object of a specified type.
- NullPointerExceptionNullPointerException is a runtime exception raised when code dereferences a null reference where a non-null object is required.
- when expressionA when expression is Kotlin's conditional expression that selects a branch based on matching conditions, including Boolean conditions when no subject argument is supplied.
- invariant generic classAn invariant type does not allow a parameterized type to substitute a subtype or supertype for its type argument.
- collectcollect is a Kotlin Flow terminal operation that suspends while collecting all emitted elements and optionally processes each element with a lambda.
- platform typeA platform type is a Kotlin type imported from Java when the Java declaration provides no nullability information, leaving Kotlin unable to determine whether its value is nullable.
- platform typeA platform type is a Kotlin type imported from Java when the Java declaration provides no nullability information, leaving Kotlin unable to determine whether its value is nullable.
- coroutine builder functionA coroutine builder function is an API function that creates and starts a coroutine with specified execution, context, and result behavior.
- suspension pointA suspension point is a point at which a suspending coroutine can pause and allow other coroutines sharing its dispatcher to execute.
- getValuegetValue is a Kotlin property-delegation operator function that retrieves a delegated property's value from a receiver and property reference.
- hash valuehashCode is an object method that returns an integer hash value consistent with the object's equality semantics.
- member referenceA member reference is a Kotlin expression that refers to a class or object member as a callable value.
- atomic typeA type is a classification that specifies the values an expression or variable can represent and the operations allowed on them.
- intermediate operationAn intermediate operator is a Flow transformation that collects values from an upstream flow and emits transformed or otherwise produced values to a downstream flow.
- default valueA default parameter is a function parameter with a value automatically supplied when the caller omits that argument.
- intervalAn interval is a connected set or span of values between specified lower and upper endpoints, with endpoint inclusion determined by its definition.
- receiverA receiver is an entity that accepts a message or signal, or an object on which a method or command operates.
- annotation classAn annotation class is a Kotlin declaration that defines the structure and parameters of an annotation type without containing executable code.
- ..< operatorThe `..<` operator constructs a range that includes its lower endpoint and excludes its upper endpoint.
- out keywordThe out modifier declares covariant use of a Kotlin type parameter so a parameterized type can accept subtype arguments.
- child coroutineA child coroutine is a coroutine launched within the scope of another coroutine and associated with that parent coroutine.
- setValuesetValue is a Kotlin property-delegation operator function that stores a delegated property's value using a receiver and property reference.
- functional, stateless philosophyFunctional programming treats computation primarily as the evaluation and composition of functions, often emphasizing immutable data and limited side effects.
- threadA thread is an independently schedulable sequence of execution within a process.
- exceptionException is the Java base class for conditions that a program may catch and handle, excluding serious errors represented by Error.
- primitive data typeA Java primitive type is one of Java's built-in value types, such as int or boolean, that is represented directly rather than as an object reference.
- public visibilityVisibility is the access-control property that determines which code can refer to a declaration.
- Kotlin standard libraryA library containing runtime definitions required by compiled Kotlin programs, including fundamental Kotlin classes and extensions to Java APIs.
- async/awaitawait is an operation that suspends a coroutine until an asynchronous computation's result is available.
- declaration-site varianceDeclaration-site variance specifies at a generic type declaration whether different instantiations are related as subtypes or supertypes based on their type arguments.
- use-site varianceUse-site variance specifies a variance constraint for a particular occurrence of a generic type parameter rather than for its declaration.
- try-catch statementA try-catch is a Kotlin exception-handling construct that executes a protected block and handles matching exceptions in catch clauses.
- non-local returnA non-local return exits the enclosing named function from within an invoked lambda rather than merely returning from the lambda.
- KCallableKCallable is a Kotlin reflection superinterface for callable functions and properties, including operations for invoking them.
- KFunctionKFunction is the Kotlin reflection interface representing a function declaration or callable function value.
- infix functionAn infix call is Kotlin call syntax that places a one-parameter function name between its receiver and argument without parentheses or other separators.
- implicit receiverAn implicit receiver is an object whose members are directly accessible within a callable body without an explicit object qualifier.
- equality-based conflationEquality-based conflation suppresses a new stream value when it is equal to the value currently represented or most recently emitted.
- get methodThe get method on a Kotlin property reference obtains the referenced property's value from a receiver object.
- FunctionN interfaceA FunctionN interface is a compiler-generated Kotlin interface representing a function value with a specific number of parameters and an invoke operation.
- flow builderA flow builder is a Kotlin coroutines function that creates a cold Flow from a suspending block capable of emitting values.
- membership operatorThe `in` operator tests whether a value belongs to a collection, range, or other container by invoking its containment operation.
- KAnnotatedElementKAnnotatedElement is a Kotlin reflection interface implemented by runtime representations of declarations that can carry annotations.
- initializerA constructor is a Kotlin class member that initializes a new instance and receives constructor arguments.
- CoroutineExceptionHandlerCoroutineExceptionHandler is a coroutine context element that handles uncaught exceptions from root coroutines launched with launch.
- lazy evaluationLazy evaluation postpones computation until a result is required and can stop processing once that result is obtained.
- @DslMarker@DslMarker is a Kotlin meta-annotation for restricting which receivers of the same DSL marker are available implicitly in nested scopes.
- html builderAn HTML builder is a type-safe builder API that constructs an HTML document or fragment through nested declarations.
- type-safe builderA type-safe builder is a builder API whose structure and allowed operations are checked by the programming language's type system.
- applyapply is a Kotlin standard-library scope function that executes a lambda with the receiver as its implicit receiver and returns that receiver.
- serializationSerialization is the process of converting an object's state into a representation that can be stored or transmitted and later reconstructed.
- backing fieldA backing field is the compiler-managed field that stores a Kotlin property's value when storage is required.
- static typingStatic typing is a language discipline in which the type of every expression is determined at compile time.
- letlet is a Kotlin standard-library function that executes a lambda with the receiver supplied as an argument and returns the lambda's result.
- destructuring declarationA destructuring declaration is Kotlin syntax that initializes multiple variables from the component values of an expression.
- const qualifierThe const modifier declares a compile-time constant property of a permitted primitive type or String type.
- expression bodyAn expression body is a Kotlin function body consisting of a single expression written after an equals sign instead of a block and explicit return statements.
- JobJob is a coroutine-context element that represents the lifecycle of a coroutine and propagates child failure to its parent under regular structured concurrency.
- interoperabilityThe ability of software components, languages, or systems to work together and exchange data or invoke one another across their boundaries.
- test dispatcherA test dispatcher is a coroutine dispatcher that schedules test coroutines, typically under controlled and often single-threaded execution.
- shareInshareIn is a kotlinx.coroutines Flow operation that converts a cold flow into a hot shared flow within a specified coroutine scope.
- upper boundAn upper bound is a constraint specifying a supertype that every valid substitution for a type parameter must satisfy.
- conditional logicA Boolean expression is an expression whose evaluation produces a Boolean value.
- anyany is a Kotlin standard-library operation that returns true when at least one element in a collection satisfies a predicate.
- in positionAn in position is a type-parameter usage position in which values of the parameterized type are consumed rather than produced.
- out positionAn out position is a type-parameter usage position in which values of the parameterized type are produced rather than consumed.
- extension function typeAn extension function type is a Kotlin function type that specifies a receiver type before the parameter types, allowing values of that type to invoke the callable using extension-function syntax.
- initializer blockThe init keyword introduces a Kotlin initializer block in a class.
- multiline stringA triple-quoted string is a Kotlin string literal delimited by three quotation marks that preserves line breaks and does not interpret ordinary escape sequences.
- @JvmField@JvmField is a Kotlin annotation that exposes a property as a Java field instead of only through accessors.
- finallyA finally block is an exception-handling block that executes after a protected block regardless of whether an exception was thrown.
- TurbineTurbine is a testing library for inspecting emissions from Kotlin Flow and other asynchronous streams.
- object expressionAn object expression is Kotlin syntax that creates an anonymous object, optionally implementing a class or interfaces, at the point where it is written.
- hashsetHashSet is a set implementation that organizes elements using hash codes for efficient membership testing.
- secondary constructorA secondary constructor is an additional Kotlin constructor declared in a class alongside its primary constructor or as the class's constructor form.
- operator modifierThe operator modifier is a Kotlin declaration modifier that permits a function to implement a predefined operator convention.
- arrayAn array is an indexed, fixed-size sequence of elements of a specified type.
- MutableSharedFlowMutableSharedFlow is a kotlinx.coroutines type that represents a shared flow whose emissions and configuration can be changed by its producer.
- context receiverA context receiver is a Kotlin language feature that lets a function declare an additional required receiver type.
- member extension functionA member extension function is a function declared as a member of one class while extending another receiver type.
- test coroutine schedulerA TestCoroutineScheduler is a scheduler that tracks and controls coroutine execution and virtual time in coroutine tests.
- KCallable.callByKCallable.callBy is a Kotlin reflection API operation that invokes a callable using a map from parameters to argument values and can apply default parameter values.
- KTypeKType is a Kotlin reflection type representing a Kotlin type, including information such as nullability.
- internal modifierThe internal modifier restricts a Kotlin declaration's visibility to code in the same module.
- lexical analysisA lexical analyzer converts an input character sequence into a list of tokens according to the input language's lexical rules.
- parsingParsing is the analysis of input according to structural or syntactic rules to identify its components and produce a structured, usable representation.
- tokenA token is a lexical unit representing either a syntactic symbol or a value in an input language.
- @CustomSerializer@CustomSerializer is a JKid annotation that associates a property with a custom value serializer.
- trailing lambdaA trailing lambda is a Kotlin lambda argument written outside a function call's parentheses when it is the call's last argument.
- concurrencyConcurrency is the execution of multiple pieces of computation during overlapping periods of time, whether or not they execute physically at the same instant.
- inheritanceInheritance is the language mechanism by which a class derives members and behavior from a superclass.
- !! operatorThe non-null assertion operator `!!` asserts that a nullable expression is non-null and throws an exception if that assertion is false.
- named argumentNamed-argument syntax specifies function or constructor arguments by writing each argument's parameter name explicitly.
- type-safe APIA type-safe API is an interface whose operations prevent invalid type combinations through compile-time type checking.
- mutable propertyA mutable property is a Kotlin property whose value can be changed after initialization.
- super keywordThe super construct accesses or invokes inherited methods, constructors, or attributes according to a language’s inheritance rules.
- componentN functionA componentN function is a Kotlin convention-named function that returns the Nth component of a composite value for use in a destructuring declaration.
- coroutine hierarchyA coroutine hierarchy is a parent-child organization of coroutines through which execution lifetimes and failures can be related.
- captured variableA captured variable is a variable that stores the subject of a Kotlin when expression and is accessible within that expression's branches.
- abstract memberAn abstract method is a method declaration without an implementation that must be implemented by a concrete implementing class.
- data conversionData conversion is the transformation of a value or data from one type, format, or representation to another, explicitly or implicitly.
- JKidJKid is a book-specific pure Kotlin library that serializes and deserializes objects as JSON using annotations and reflection.
- IntArrayIntArray is Kotlin's specialized array type whose elements are 32-bit integers stored without boxing.
- return typeA return type is the statically determined type of the value returned by a function.
- Dispatchers.MainDispatchers.Main is a coroutine dispatcher that schedules coroutine work on the application's main or UI thread.
- supervisorScopesupervisorScope is a kotlinx.coroutines suspending function that creates a coroutine scope with supervisor semantics for its child coroutines.
- finalThe final modifier prevents a Kotlin class from being subclassed or a class member from being overridden.
- enumAn enum is a Kotlin type whose instances are restricted to a fixed set of named constants.
- nested classA nested class is a class declared inside another class; in Kotlin, it does not implicitly reference an instance of the enclosing class.
- isMarkedNullableisMarkedNullable is a Kotlin reflection property that indicates whether a reflected type is declared nullable.
- isOptionalisOptional is a Kotlin reflection property that indicates whether a callable parameter has a default value and may be omitted.
- KParameter.typeKParameter.type is a Kotlin reflection property that returns the reflected Kotlin type of a callable parameter.
- Kotlin compilerThe Kotlin compiler translates Kotlin source code into executable output for supported target platforms and performs compile-time checks.
- stateInstateIn is a kotlinx.coroutines Flow operator that converts a flow into a state flow running in a specified coroutine scope.
- open modifierThe open modifier is a Kotlin declaration modifier that permits a class or member to be inherited or overridden.
- boxed primitiveA wrapper type is a Java reference type that represents a value of a corresponding primitive type, such as Integer for int.
- Java-to-Kotlin converterA Java-to-Kotlin converter is a tool that translates Java source code into functionally equivalent Kotlin source code.
- use-site targetA use-site target specifies which generated bytecode element receives an annotation when one Kotlin declaration produces multiple elements.
- inline classAn inline class is a Kotlin class with exactly one primary-constructor property whose values are represented by the underlying property type wherever possible rather than by allocated wrapper objects.
- nullish coalescing operatorThe Elvis operator `?:` evaluates its left operand when non-null and otherwise evaluates and returns its right operand.
- withwith is a Kotlin standard-library scope function that executes a block with an object as its receiver and returns the block result.
- channel flowchannelFlow is a Kotlin coroutine builder that creates a cold flow supporting concurrent emissions from multiple coroutines.
- MapHashMap is a hash-table-based Java map implementation that stores key-value associations and uses key hash codes for lookup.
- missing valueA null value represents the absence of an object or reference value in a program.
- ClassCastExceptionClassCastException is a JVM runtime exception thrown when a value is used as an incompatible type.
- type aliasA type alias is a Kotlin declaration that gives an alternative name to an existing type without creating a distinct type.
- emitemit is the FlowCollector operation that publishes a value to a Flow collector and may suspend or respond to cancellation.
- pure functionA pure function is a function whose output is determined solely by its explicit inputs and whose evaluation has no externally observable side effects.
- local functionA local function is a function declared within another function or local scope rather than at the top level or as a class member.
- type projectionA type projection is a restricted view of a parameterized type that permits only operations allowed by a use-site variance constraint.
- explicit API modeExplicit API mode is a Kotlin compiler mode that requires explicitly declared public API types and related signatures.
- moduleA module is a distinct unit of Kotlin compilation whose declarations share an internal visibility boundary.
- private memberThe private modifier restricts access to a Kotlin declaration to its containing class or, for top-level declarations, its containing file.
- protected memberThe protected modifier restricts access to a declaration to its containing class and subclasses in Kotlin.
- class delegationClass delegation is a Kotlin language feature that generates interface-member implementations by forwarding them to a specified delegate object.
- default methodA default implementation is a member implementation provided by an interface that implementing types can inherit without redefining it.
- constructor parameterA constructor parameter is a parameter declared by a Kotlin constructor and optionally promoted to a property.
- hash code contractThe hash code contract requires equal objects to produce the same hash code.
- toStringtoString is an object method that returns a textual representation of the object.
- MutableStateFlowMutableStateFlow is a kotlinx.coroutines type that represents a state flow whose current value can be updated.
- resource leakA resource leak is the unintended retention or failure to release of resources such as threads, memory, or active concurrent tasks.
- custom operatorA custom operator is a programmer-provided implementation of a predefined operator symbol.
- kotlinx.coroutineskotlinx.coroutines is JetBrains' Kotlin library providing coroutine builders, synchronization primitives, and other concurrency APIs.
- regular expressionA regular expression is a pattern language for matching, searching, or transforming text according to character and repetition rules.
- companion-object extensionA companion-object extension is an extension function or property declared on a class's companion object and callable through the class name.
- @JvmStatic@JvmStatic is a Kotlin annotation that causes a companion-object or object member to be exposed as a static method to Java code.
- MutableMapMutableMap is a Kotlin collection interface representing key-value associations that can be modified.
- inner classAn inner class is a class declared inside another class and associated with an instance of the containing class.
- Dispatchers.DefaultDispatchers.Default is a Kotlin coroutines dispatcher backed by a shared pool of worker threads for general-purpose coroutine execution.
- Dispatchers.IODispatchers.IO is the Kotlin coroutines dispatcher backed by an automatically scaling thread pool for blocking input/output operations.
- read-only propertyA read-only property is a Kotlin property that can be accessed but not reassigned through its public declaration.
- operator functionAn operator function is a Kotlin function marked with the operator modifier whose name and parameters implement a predefined operator convention.
- extension propertyAn extension property is a Kotlin property that provides property-like access to an existing type without storing state in that type.
- this expressionA labeled this expression is a Kotlin expression that refers to the receiver associated with a specified label.
- boxingBoxing is the representation of a primitive value as an object instance such as java.lang.Integer.
- primitive arrayA primitive array is an array specialized for values of a primitive type and represented as a Java primitive array without boxing.
- encapsulationInformation hiding is the design principle of concealing implementation details behind a restricted public interface.
- CancellationExceptionCancellationException is an exception used by Kotlin coroutines to signal that a coroutine has been cancelled.
- runBlockingrunBlocking is a kotlinx.coroutines coroutine builder that blocks the current thread while executing a coroutine and its suspending operations.
- KtorKtor is a Kotlin framework for building connected applications, including servers and clients that make network requests.
- upstream flowAn upstream flow is the portion of a flow, including preceding intermediate operators, that occurs before a specified operator.
- implicit lambda parameterAn implicit lambda parameter is the automatically generated name `it` for the sole parameter of a Kotlin lambda when its type can be inferred.
- retryA retry is a subsequent attempt to perform an operation after an earlier attempt fails or does not complete successfully.
- sealed typeA sealed interface is a Kotlin interface whose implementations are restricted to a known set once its containing module is compiled.
- unit typeA unit type is a type with exactly one value, commonly written (), that represents the absence of meaningful information or a meaningful result.
- error propagationError propagation is the transmission of an error or exception from the computation where it occurs to an enclosing or related computation.
- delay()delay is a coroutine-suspending function that pauses a coroutine for a specified duration without blocking its underlying thread.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
