Kotlin Study Cards

Enhance Your Understanding with Kotlin Flash Cards for quick learning



Kotlin

A modern programming language developed by JetBrains, designed to be fully interoperable with Java and provide improved syntax and features.

Variables

Containers for storing data in memory, allowing you to manipulate and retrieve the stored values.

Data Types

The classification of data that determines the possible values and operations that can be performed on it, such as Int, String, Boolean, etc.

Control Flow

The order in which statements are executed in a program, controlled by conditional statements (if, else) and loops (for, while).

Functions

Reusable blocks of code that perform a specific task, allowing you to modularize your code and improve code organization.

Classes

Blueprints for creating objects, defining their properties (attributes) and behaviors (methods).

Objects

Instances of classes that encapsulate data and behavior, allowing you to create and manipulate multiple objects based on a single class definition.

Inheritance

A mechanism that allows a class to inherit properties and methods from another class, promoting code reuse and creating a hierarchical relationship.

Polymorphism

The ability of an object to take on many forms, allowing objects of different classes to be treated as objects of a common superclass.

Collections

Containers that hold multiple values, such as lists, sets, and maps, providing convenient methods for manipulating and accessing the data.

Null Safety

A feature in Kotlin that helps prevent null pointer exceptions by distinguishing nullable and non-nullable types, reducing the risk of null-related bugs.

Exception Handling

The process of dealing with runtime errors and abnormal conditions in a program, allowing you to catch and handle exceptions gracefully.

Coroutines

A concurrency design pattern in Kotlin that allows you to write asynchronous code in a sequential manner, simplifying the handling of asynchronous operations.

Smart Casts

A feature in Kotlin that automatically casts an object to a specific type when certain conditions are met, reducing the need for explicit type checks and casts.

Extension Functions

Functions that can be added to existing classes without modifying their source code, providing a way to extend the functionality of classes from external libraries or APIs.

Lambda Expressions

Anonymous functions that can be treated as values, allowing you to pass behavior as arguments or store them in variables, making code more concise and expressive.

Higher-Order Functions

Functions that can accept other functions as parameters or return functions as results, enabling the creation of more flexible and reusable code.

Type Inference

The ability of the Kotlin compiler to automatically determine the data type of a variable based on its initialization value, reducing the need for explicit type declarations.

Ranges

A sequence of values defined by a start and end value, allowing you to iterate over the range or check if a value falls within the range.

String Templates

A feature in Kotlin that allows you to embed expressions inside string literals, making it easier to concatenate variables and expressions with strings.

Companion Objects

Objects that are tied to a class rather than an instance of the class, allowing you to define static members and access them without creating an instance of the class.

Destructuring Declarations

A feature in Kotlin that allows you to extract multiple values from an object or data structure and assign them to individual variables in a single statement.

Operator Overloading

The ability to redefine the behavior of operators for custom types, allowing you to perform operations on objects using familiar syntax.

Sealed Classes

Classes that restrict the inheritance hierarchy, allowing a limited set of subclasses, providing a way to define closed types and exhaustive when expressions.

Default Arguments

The ability to specify default values for function parameters, allowing you to call the function without providing values for all parameters.

Named Arguments

The ability to specify function arguments by name, allowing you to provide arguments in any order and improve code readability.

Late Initialization

The ability to declare a non-null variable without initializing it immediately, allowing you to assign a value to the variable later in the code.

Property Delegation

A mechanism that allows you to delegate the implementation of property accessors to another object, providing a way to customize the behavior of properties.

Data Classes

Classes that are designed to hold data, automatically generating useful methods such as equals(), hashCode(), and toString().

Scope Functions

Functions that provide a temporary scope for executing code on an object, allowing you to perform operations on the object without the need for explicit references.

Type Aliases

A feature in Kotlin that allows you to create alternative names for existing types, improving code readability and providing semantic meaning.

Inline Functions

Functions that are expanded at compile time, reducing the overhead of function calls and allowing you to pass lambdas as arguments without creating additional objects.

Immutable Collections

Collections that cannot be modified after they are created, ensuring data integrity and preventing accidental modifications.

Mutable Collections

Collections that can be modified after they are created, allowing you to add, remove, or update elements as needed.

Higher-Order Extension Functions

Extension functions that accept other functions as parameters or return functions as results, providing a way to extend the functionality of existing classes.

Type Constraints

Restrictions on the types that can be used as type arguments in generic classes or functions, ensuring type safety and preventing incompatible types.

Safe Calls

A feature in Kotlin that allows you to safely access properties or call methods on nullable objects, returning null if the object is null.

Elvis Operator

A shorthand notation in Kotlin that allows you to provide a default value when accessing a nullable object, returning the default value if the object is null.

Extension Properties

Properties that can be added to existing classes without modifying their source code, providing a way to extend the properties of classes from external libraries or APIs.

Top-Level Functions

Functions that are defined outside of any class, allowing you to call them directly without the need for an instance of a class.

Companion Functions

Functions that are tied to a class rather than an instance of the class, allowing you to define static functions and call them without creating an instance of the class.

When Expression

A powerful control flow construct in Kotlin that allows you to perform different actions based on the value of an expression, providing a concise alternative to if-else chains.