Add missing kotlin content

This commit is contained in:
Kamran Ahmed
2026-05-14 11:12:44 +01:00
parent 839f65492b
commit 7fd143cd9f
153 changed files with 1284 additions and 153 deletions
@@ -1 +1,9 @@
# Abstract Class
# Abstract Class
An abstract class in Kotlin is a class that cannot be instantiated directly. It's designed to be a blueprint for other classes. Abstract classes can contain both abstract members (methods and properties without implementation) and concrete members (with implementation). Subclasses (derived classes) must implement the abstract members, providing their specific behavior, unless the subclass itself is also declared abstract. This enforces a certain structure and behavior across a family of related classes.
Visit the following resources to learn more:
- [@official@Abstract classes](https://kotlinlang.org/docs/classes.html#abstract-classes)
- [@article@Kotlin Abstract Class](https://www.programiz.com/kotlin-programming/abstract-class)
- [@video@Kotlin Newbie to Pro - ABSTRACT CLASSES](https://www.youtube.com/watch?v=ju-LDSDwGC8)
@@ -1 +1,8 @@
# Aggregate Operations
# Aggregate Operations
Aggregate operations in Kotlin collections transform a collection into a single result. These operations combine the elements of a collection using a specific function. Common examples include finding the sum, average, minimum, or maximum value within a collection. They provide a concise way to derive a summary value from a set of data.
Visit the following resources to learn more:
- [@official@Aggregate operations](https://kotlinlang.org/docs/collection-aggregate.html)
- [@video@Collections | fold | reduce | aggregate functions](https://www.youtube.com/watch?v=2dteZg_1TZ0)
@@ -1 +1,9 @@
# AI Development
# AI Development
Kotlin provides a modern and pragmatic foundation for building AI-powered applications.
It can be used across platforms, integrates well with established AI frameworks, and supports common AI development patterns through its AI agentic framework, Koog. There are many use cases where Kotlin can help with AI development, from integrating language models into backend services to building AI-powered user interfaces.
Visit the following resources to learn more:
- [@official@Kotlin for AI-powered app development](https://kotlinlang.org/docs/kotlin-ai-apps-development-overview.html)
- [@opensource@Kotlin AI Examples](https://github.com/Kotlin/Kotlin-AI-Examples)
@@ -1 +1,8 @@
# Android Jetpack
# Android Jetpack
Android Jetpack is a suite of libraries, tools, and architectural guidance designed to help developers build robust, testable, and maintainable Android applications more easily. It addresses common Android development challenges by providing pre-built components for tasks like managing UI, data persistence, background processing, and navigation, allowing developers to focus on writing unique application logic. These components are designed to work together seamlessly and are backward-compatible, ensuring apps work across a wide range of Android versions.
Visit the following resources to learn more:
- [@article@Kotlin for Jetpack](https://developer.android.com/develop/ui/compose/kotlin)
- [@course@Android Basics with Compose](https://developer.android.com/courses/android-basics-compose/course)
@@ -1 +1,9 @@
# Android SDK
# Android SDK
The Android SDK (Software Development Kit) is a set of tools, libraries, documentation, and sample code provided by Google that allows developers to create applications for the Android operating system. It provides the necessary APIs and development environment to build, test, and debug Android apps. The SDK includes tools for compiling code, debugging, emulating devices, and packaging applications for distribution.
Visit the following resources to learn more:
- [@official@Kotlin for Android](https://kotlinlang.org/docs/android-overview.html)
- [@article@Develop Android apps with Kotlin](https://developer.android.com/kotlin)
- [@official@Android & Kotlin Development Masterclass – Full Course](https://www.youtube.com/watch?v=blKkRoZPxLc&ab_channel=freeCodeCamp.org)
@@ -1 +1,9 @@
# Android Studio
# Android Studio
Android Studio is the official Integrated Development Environment (IDE) for Android app development, and it fully supports Kotlin. It provides tools for coding, debugging, testing, and designing user interfaces for Android applications. With features like code completion, refactoring, and a visual layout editor, Android Studio streamlines the process of building Kotlin-based Android apps.
Visit the following resources to learn more:
- [@official@Kotlin for Android](https://kotlinlang.org/docs/android-overview.html)
- [@article@Develop Android apps with Kotlin](https://developer.android.com/kotlin)
- [@course@Introduction to programming in Kotlin](https://developer.android.com/courses/pathways/android-basics-compose-unit-1-pathway-1)
@@ -1 +1,9 @@
# Android Studio
# Android Studio
Android Studio is the official Integrated Development Environment (IDE) for Android app development, built on JetBrains' IntelliJ IDEA. It provides a comprehensive suite of tools for designing, developing, debugging, and testing Android applications. It includes features like a visual layout editor, code completion, debugging tools, and integration with the Android SDK and emulator.
Visit the following resources to learn more:
- [@official@Android Studio](https://developer.android.com/studio)
- [@official@Develop Android apps with Kotlin](https://developer.android.com/kotlin)
- [@video@Android & Kotlin Development Masterclass – Full Course](https://www.youtube.com/watch?v=blKkRoZPxLc)
@@ -1 +1,8 @@
# Anonymous Functions
# Anonymous Functions
Anonymous functions in Kotlin are functions without a name. They are defined using a lambda expression but with an explicit return type and the `return` keyword for returning values. They are useful when you need to define a function inline, often as an argument to another function or when assigning a function to a variable, especially when the function logic is more complex than a simple expression.
Visit the following resources to learn more:
- [@official@Anonymous Functions](https://kotlinlang.org/docs/lambdas.html#anonymous-functions)
- [@article@Kotlin Lambda Expressions + Kotlin Anonymous Functions](https://medium.com/huawei-developers/kotlin-lambda-expressions-kotlin-anonymous-functions-example-tutorial-88a4b622f8b9)
@@ -1 +1,7 @@
# Arrays
# Arrays in Kotlin
Arrays in Kotlin are used to store a fixed-size, sequential collection of elements of the same data type. Think of them as a container that holds multiple values of the same kind, like a list of integers, strings, or even custom objects. You can access each element in the array using its index, which starts from zero. Arrays are fundamental for organizing and manipulating collections of data in your programs.
Visit the following resources to learn more:
- [@official@Arrays](https://kotlinlang.org/docs/arrays.html)
@@ -1 +1,9 @@
# Asynchronous Flow
# Asynchronous Flow
Asynchronous Flow in Kotlin is a feature built upon coroutines that allows you to represent a stream of data that is computed asynchronously. It's designed to handle sequences of values emitted over time, enabling you to perform operations on each emitted value in a non-blocking manner. This is particularly useful for handling data streams from sources like network requests, database queries, or sensor readings, where values become available at different times.
Visit the following resources to learn more:
- [@official@Asynchronous Flow](https://kotlinlang.org/docs/flow.html)
- [@article@Kotlin flows on Android](https://developer.android.com/kotlin/flow)
- [@video@Kotlin Flows in practice](https://www.youtube.com/watch?v=fSB6_KE95bU)
@@ -1 +1,7 @@
# Booleans
# Booleans
Booleans represent truth values: either `true` or `false`. They are fundamental for decision-making in code, allowing programs to execute different blocks of code based on whether a condition is met. In Kotlin, the `Boolean` type is used to declare variables that can hold these two values, enabling logical operations and conditional statements.
Visit the following resources to learn more:
- [@official@Booleans](https://kotlinlang.org/docs/booleans.html)
@@ -1 +1,8 @@
# break & continue
# Break and Continue in Kotlin Loops
In Kotlin, `break` and `continue` are control flow statements used within loops. The `break` statement immediately terminates the loop's execution and transfers control to the next statement after the loop. Conversely, the `continue` statement skips the rest of the current iteration of the loop and proceeds to the next iteration. They provide a way to alter the normal flow of a loop based on certain conditions.
Visit the following resources to learn more:
- [@official@Break and continue labels](https://kotlinlang.org/docs/returns.html#break-and-continue-labels)
- [@video@Break | Continue | Return - A fresh look](https://www.youtube.com/watch?v=qMyJd0ihUTg)
@@ -1 +1,9 @@
# Buffered Streams
# Buffered Streams
Buffered streams in Kotlin enhance the efficiency of reading from and writing to data sources. Instead of directly interacting with the underlying input or output stream for every read or write operation, buffered streams use an internal buffer. This buffer temporarily stores data, reducing the number of actual I/O operations and improving performance, especially when dealing with small, frequent read/write requests.
Visit the following resources to learn more:
- [@article@https://developer.android.com/reference/kotlin/java/io/BufferedInputStream](https://developer.android.com/reference/kotlin/java/io/BufferedInputStream)
- [@article@BufferedOutputStream](https://developer.android.com/reference/kotlin/java/io/BufferedOutputStream)
- [@video@Efficient IO With Buffered Reading & Writing In Kotlin - IO Essentials](https://www.youtube.com/watch?v=GFo5KPaY-zU)
@@ -1 +1,7 @@
# Build Tool API
# Build Tool API
The Build Tool API in Kotlin provides a way for build tools like Gradle or Maven to interact with the Kotlin compiler and related tooling. It allows these tools to configure the compilation process, access compiler options, and integrate Kotlin code into the overall build lifecycle. This API enables build tools to manage dependencies, generate code, and perform other tasks necessary for building Kotlin projects. Currently, the BTA supports Kotlin/JVM only.
Visit the following resources to learn more:
- [@official@Build tools API](https://kotlinlang.org/docs/build-tools-api.html)
@@ -1 +1,7 @@
# Build Tools
# Build Tools
Build tools in Kotlin automate tasks like compiling code, running tests, and packaging applications. They manage dependencies, ensuring your project has all the necessary libraries. Popular choices include Gradle and Maven, which use configuration files to define the build process and handle project structure, making it easier to build and distribute Kotlin applications.
Visit the following resources to learn more:
- [@article@Understanding Kotlin Build Tools Made Simple](https://www.dhiwise.com/post/understanding-kotlin-build-tools-made-simple)
@@ -1 +1,7 @@
# C Interoperability
# C Interoperability in Kotlin/Native
C Interoperability in Kotlin/Native allows Kotlin code to interact with C libraries and code. This means you can use existing C libraries within your Kotlin/Native projects, and also expose Kotlin/Native code to be used from C. It involves mapping C data types and functions to their Kotlin equivalents, enabling seamless communication between the two languages.
Visit the following resources to learn more:
- [@official@Interoperability with C](https://kotlinlang.org/docs/native-c-interop.html)
@@ -1 +1,7 @@
# Catching Exceptions
# Catching Exceptions
Catching exceptions handle the unexpected exception manually by resolving the issue or notifying the developer or application user. When an exception is thrown, it interrupts the normal execution of the program. You can handle exceptions gracefully with the `try` and `catch` keywords to keep your program stable. The `try` block contains the code that might throw an exception, while the `catch` block catches and handles the exception if it occurs. The exception is caught by the first `catch` block that matches its specific type or a superclass of the exception.
Visit the following resources to learn more:
- [@official@Handle exceptions using try-catch blocks](https://kotlinlang.org/docs/exceptions.html#handle-exceptions-using-try-catch-blocks)
@@ -1 +1,7 @@
# Characters
# Characters
Characters in Kotlin represent single symbols, like letters, numbers, or punctuation marks. They are denoted by the `Char` type and are enclosed in single quotes (e.g., `'A'`, `'7'`, `'$'`). You can use characters to store and manipulate individual text elements within your programs. Kotlin supports Unicode characters, allowing you to represent a wide range of symbols from different languages.
Visit the following resources to learn more:
- [@official@Characters](https://kotlinlang.org/docs/characters.html)
@@ -1 +1,3 @@
# CI/CD Tools
# CI/CD Tools
CI/CD tools are software that automates building, testing, and deploying code changes in a software development workflow, enabling faster and more reliable releases of high-quality software. They are the backbone of continuous integration (CI) and continuous delivery/deployment (CD) practices, which automate the software delivery pipeline to reduce risks and deliver value to customers more quickly. TeamCity, for example, is a CI/CD server that can be used to automate these processes for Kotlin projects.
@@ -1 +1,8 @@
# Class Generics
# Class Generics
Generics in Kotlin allow you to define classes that can work with different types of data without specifying those types upfront. Think of it like a template for a class. Instead of writing separate classes for handling integers, strings, or other data types, you can create a single generic class that can handle any type you specify when you create an instance of the class. This makes your code more reusable and type-safe, as the compiler can check that you're using the correct types with your generic class.
Visit the following resources to learn more:
- [@official@Generics: in, out, where](https://kotlinlang.org/docs/generics.html)
- [@video@Kotlin Generics - How to create generic classes](https://www.youtube.com/watch?v=tddbTT_v1BE)
@@ -1 +1,8 @@
# Class Members
# Class Members in Kotlin
In Kotlin, a class member refers to the variables (properties) and functions (methods) that belong to a class. Properties hold data associated with the class, defining its state, while methods define the behavior or actions that the class can perform. These members are accessed using the dot notation on an instance of the class. They can be declared as either mutable (using `var`) or read-only (using `val`), and their visibility can be controlled using modifiers like `public`, `private`, and `protected`.
Visit the following resources to learn more:
- [@official@Class members](https://kotlinlang.org/docs/classes.html#class-members)
- [@video@Kotlin Classes & Objects Explained 🚀 | OOP in Kotlin | Kotlin Crash Course](https://www.youtube.com/watch?v=1WF2Q_UJgps)
@@ -1 +1,11 @@
# Code Organization
# Code Organization
In pure Kotlin projects, the recommended directory structure follows the package structure with the common root package omitted. For example, if all the code in the project is in the `org.example.kotlin` package and its subpackages, files with the `org.example.kotlin` package should be placed directly under the source root, and files in `org.example.kotlin.network.socke
t` should be in the `network/socket` subdirectory of the source root.
If a Kotlin file contains a single class or interface (potentially with related top-level declarations), its name should be the same as the name of the class, with the .kt extension appended. It applies to all types of classes and interfaces. If a file contains multiple classes, or only top-level declarations, choose a name describing what the file contains, and name the file accordingly. Use upper camel case, where the first letter of each word is capitalized. For example, ProcessDeclarations.kt
Visit the following resources to learn more:
- [@official@Source code organization](https://kotlinlang.org/docs/coding-conventions.html#source-code-organization)
- [@video@Full 2025 Kotlin Crash Course For Beginners](https://www.youtube.com/watch?v=dzUc9vrsldM)
@@ -1 +1,9 @@
# Collections
# Collections
Collections in Kotlin are structures that hold multiple items together. Think of them as containers for data. They can be lists of things, sets of unique items, or maps that pair keys with values. Kotlin provides built-in collection types like `List`, `Set`, and `Map`, along with functions to easily add, remove, and manipulate the data within them. These collections can be either mutable (changeable) or immutable (read-only), offering flexibility in how you manage your data.
Visit the following resources to learn more:
- [@official@Collections](https://kotlinlang.org/docs/basic-syntax.html#collections)
- [@article@Collections Overview](https://kotlinlang.org/docs/collections-overview.html)
- [@video@Kotlin Collections](https://www.youtube.com/watch?v=NuuMC4mmzzQ)
@@ -1 +1,7 @@
# Comments
# Comments
Comments are explanatory notes added to code to make it easier to understand. In Kotlin, you can add single-line comments using `//`. Anything after `//` on the same line is ignored by the compiler. For multi-line comments, you can use `/*` to begin the comment and `*/` to end it. Everything between `/*` and `*/` will be treated as a comment and not executed as code.
Visit the following resources to learn more:
- [@official@Comments](https://kotlinlang.org/docs/basic-syntax.html#comments)
@@ -1 +1,8 @@
# Competitive Programming
# Competitive Programming with Kotlin
Kotlin can be used for competitive programming due to its concise syntax, standard library, and interoperability with Java. It allows programmers to write efficient and readable code, which is crucial for solving algorithmic problems quickly. Kotlin's features like data classes, extension functions, and null safety can help reduce boilerplate and improve code quality in a competitive programming environment.
Visit the following resources to learn more:
- [@official@Kotlin for competitive programming](https://kotlinlang.org/docs/competitive-programming.html)
- [@article@Start Competitive Programming with Kotlin](https://medium.com/codex/start-competitive-programming-with-kotlin-ab704fb5bcda)
@@ -1 +1,9 @@
# Compose Multiplatform
# Compose Multiplatform
Compose Multiplatform is a declarative UI framework that allows developers to share user interface code across multiple platforms, including Android, iOS, desktop (Windows, macOS, Linux), and web. It's based on Jetpack Compose, Google's modern UI toolkit for Android, and leverages Kotlin's multiplatform capabilities to enable code reuse while maintaining a native look and feel on each target platform. This approach streamlines UI development by reducing platform-specific code and promoting consistency across different applications.
Visit the following resources to learn more:
- [@official@Compose Multiplatform](https://www.jetbrains.com/compose-multiplatform/)
- [@opensource@Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform)
- [@video@The Compose Multiplatform Crash Course for 2025](https://www.youtube.com/watch?v=WT9-4DXUqsM)
@@ -1 +1,7 @@
# Conditional Expressions
# Conditional Expressions
Conditional expressions allow you to execute different blocks of code based on whether a condition is true or false. They provide a way to make decisions within your program, enabling it to respond differently to various inputs or situations. In Kotlin, this is primarily achieved using `if` and `when` expressions. These expressions evaluate a boolean condition and execute the corresponding code block.
Visit the following resources to learn more:
- [@official@If expression](https://kotlinlang.org/docs/control-flow.html#if-expression)
@@ -1 +1,9 @@
# Constructors
# Constructors
Constructors in Kotlin are special member functions within a class that are used to initialize objects of that class. They define how an object is created and what initial values its properties will have. Kotlin has two types of constructors: primary and secondary. The primary constructor is part of the class header, while secondary constructors are defined inside the class body using the `constructor` keyword. A class can have one primary constructor and multiple secondary constructors.
Visit the following resources to learn more:
- [@official@Constructors](https://kotlinlang.org/docs/classes.html#constructors)
- [@article@Define a constructor](https://developer.android.com/codelabs/basic-android-kotlin-compose-classes-and-objects#5)
- [@video@Kotlin Classes and Constructors - Primary vs Secondary](https://www.youtube.com/watch?v=Ly_onmXpDiw)
@@ -1 +1,8 @@
# Coroutines Behavior
# Coroutines Behavior
Launching a coroutine from a `CoroutineScope` creates a context that governs its execution. Builder functions like `.launch()` and `.async()` automatically create a set of elements that define how the coroutine behaves, including the `Job` interface, which tracks the coroutine's lifecycle and enables structured concurrency; `CoroutineDispatcher`, which controls where the coroutine runs; and `CoroutineExceptionHandler`, which handles uncaught exceptions.
Visit the following resources to learn more:
- [@official@Coroutine concepts](https://kotlinlang.org/docs/coroutines-basics.html)
- [@video@Coroutine Contexts - Kotlin Coroutines](https://www.youtube.com/watch?v=71NrkkRNXG4)
@@ -1 +1,8 @@
# Coroutines Best practices
# Coroutines Best Practices
Coroutines in Kotlin simplify asynchronous programming, but using them effectively requires following certain best practices. These include using structured concurrency to manage coroutine lifecycles and prevent leaks, avoiding `GlobalScope` for most tasks and preferring `CoroutineScope` tied to specific components, handling exceptions properly within coroutines, and offloading long-running or blocking operations to appropriate dispatchers like `Dispatchers.IO` to avoid blocking the main thread. Additionally, it's important to cancel coroutines when they are no longer needed to free up resources and prevent unnecessary work.
Visit the following resources to learn more:
- [@article@Coroutine: Best Practices](https://medium.com/@vivekbansal19/coroutine-best-practices-affddb50ae1b)
- [@article@Best practices for coroutines in Android](https://developer.android.com/kotlin/coroutines/coroutines-best-practices)
@@ -1 +1,8 @@
# Coroutines Builders
# Coroutine Builders
Coroutine builders in Kotlin are functions that start a new coroutine. They bridge the gap between regular, blocking code and the non-blocking, concurrent world of coroutines. Common builders include `launch`, which starts a coroutine without blocking the current thread and returns a `Job`, and `runBlocking`, which blocks the current thread until the coroutine completes, primarily used for testing and main functions. Another builder, `async`, starts a coroutine and returns a `Deferred` object, which represents a future result. These builders allow you to execute code concurrently and manage the lifecycle of coroutines.
Visit the following resources to learn more:
- [@official@Coroutines basics](https://kotlinlang.org/docs/coroutines-basics.html#your-first-coroutine)
- [@article@Kotlin Coroutine builders](https://medium.com/@appdevinsights/kotlin-coroutine-builders-6a6639cc478d)
@@ -1 +1,9 @@
# Coroutines
# Kotlin Coroutines
To support efficient concurrency, Kotlin uses asynchronous programming built around coroutines, which let you write asynchronous code in a natural, sequential style using suspending functions. Coroutines are lightweight alternatives to threads. They can suspend without blocking system resources and are resource-friendly, making them better suited for fine-grained concurrency. Most coroutine features are provided by the `kotlinx.coroutines` library, which includes tools for launching coroutines, handling concurrency, working with asynchronous streams, and more.
Visit the following resources to learn more:
- [@official@Coroutines](https://kotlinlang.org/docs/coroutines-overview.html#coroutines-overview.md)
- [@opensource@kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines)
- [@video@WHAT IS A COROUTINE? - Kotlin Coroutines](https://www.youtube.com/watch?v=ShNhJ3wMpvQ)
@@ -1 +1,10 @@
# Coroutines
# Coroutines
Kotlin Coroutines provide a way to write asynchronous, non-blocking code in a sequential style. They allow you to perform long-running tasks, like network requests or database operations, without blocking the main thread, thus preventing your application from becoming unresponsive. Coroutines are lightweight threads that can be suspended and resumed, making it easier to manage concurrency and improve application performance.
Visit the following resources to learn more:
- [@official@Coroutines](https://kotlinlang.org/docs/coroutines-overview.html)
- [@opensource@kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines)
- [@article@Kotlin coroutines on Android](https://developer.android.com/kotlin/coroutines)
- [@video@Kotlin Coroutine (High-quality Course)](https://www.youtube.com/watch?v=lmRzRKIsn1g)
@@ -1 +1,7 @@
# Creating Files
# Creating Files
In Kotlin, you can create new files using the `File` class from the `java.io` package. To do this, you first create a `File` object representing the desired file path. Then, you call the `createNewFile()` method on that `File` object. This method attempts to create a new, empty file at the specified location. It returns `true` if the file was successfully created and `false` if a file with that name already exists or if there was an error during creation.
Visit the following resources to learn more:
- [@article@Working With Files In Kotlin - IO Essentials](https://www.youtube.com/watch?v=MSeI7XVzrvo)
@@ -1 +1,9 @@
# Creating Instances
# Creating Instances
In Kotlin, creating an instance of a class is straightforward. You simply use the class name followed by parentheses, similar to calling a function. This invokes the class's constructor, which initializes the object. If the class has a primary constructor, you'll need to provide the required arguments within the parentheses. If there's no explicit constructor defined, Kotlin provides a default one.
Visit the following resources to learn more:
- [@official@Creating instances of classes](https://kotlinlang.org/docs/classes.html#creating-instances-of-classes)
- [@article@Create an instance of a class](https://developer.android.com/codelabs/basic-android-kotlin-compose-classes-and-objects#2)
- [@video@Kotlin Classes & Objects Explained 🚀 | OOP in Kotlin | Kotlin Crash Course](https://www.youtube.com/watch?v=1WF2Q_UJgps)
@@ -1 +1,10 @@
# Data Analysis
# Data Analysis with Kotlin
Data analysis involves examining raw data to draw conclusions about that information. Kotlin, primarily known for Android development, can also be used for data analysis. With Kotlin's Exploratory Data Analysis (EDA) tools, such as Kotlin notebooks, Kotlin DataFrame, and Kandy, you have at your disposal a rich set of capabilities to enhance your analytics skills and support you across different scenarios:
Visit the following resources to learn more:
- [@official@Kotlin for data analysis](https://kotlinlang.org/docs/data-analysis-overview.html)
- [@official@Kotlin and Java libraries for data analysis](https://kotlinlang.org/docs/data-analysis-libraries.html)
- [@article@A Step-by-Step Guide to Performing Data Analysis With Kotlin DataFrame](https://blog.jetbrains.com/kotlin/2024/04/a-step-by-step-guide-to-performing-data-analysis-with-kotlin-dataframe/)
- [@video@Data Analytics With Kotlin Notebooks](https://www.youtube.com/watch?v=_RYV7ZvMKpE)
@@ -1 +1,8 @@
# Data Classes
# Data Classes
Data classes in Kotlin are special classes designed to hold data. The compiler automatically generates useful methods like `equals()`, `hashCode()`, `toString()`, `componentN()` functions (for destructuring), and `copy()` for you. This reduces boilerplate code when you primarily need a class to store and manage data.
Visit the following resources to learn more:
- [@official@Data classess](https://kotlinlang.org/docs/data-classes.html#data-classes.md)
- [@video@Data classes - Kotlin Vocabulary](https://www.youtube.com/watch?v=PlywDf1dAnA)
@@ -1 +1,8 @@
# Data types
# Data Types in Kotlin
Kotlin, like other programming languages, uses data types to classify different kinds of values. These types define what operations can be performed on the data and how much memory it occupies. In Kotlin, everything is an object in the sense that you can call member functions and properties on any variable. While certain types have an optimized internal representation as primitive values at runtime (such as numbers, characters, and booleans), they appear and behave like regular classes to you.
Visit the following resources to learn more:
- [@official@Basic Types](https://kotlinlang.org/docs/basic-types.html)
- [@article@Data types in Kotlin](https://www.w3schools.com/kotlin/kotlin_data_types.php)
@@ -1 +1,10 @@
# Date & Time
# Date & Time
Kotlin leverages Java's `java.time` package (introduced in Java 8) for handling dates and times, offering classes like `LocalDate`, `LocalTime`, and `LocalDateTime`. Kotlin also provides extensions and convenience functions within its standard library, such as the kotlinx.datetime library, to work with dates and times. This allows you to easily represent, manipulate, and format date and time information in your Kotlin applications.
Visit the following resources to learn more:
- [@opensource@kotlinx.datetime](https://github.com/Kotlin/kotlinx-datetime)
- [@official@Time measurement](https://kotlinlang.org/docs/time-measurement.html)
- [@official@java.time](https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html)
- [@video@The Full Guide About the DateTime API in Kotlin](https://www.youtube.com/watch?v=gzHy6wKAJh8)
@@ -1 +1,7 @@
# Default Imports
# Default Imports
Default imports are a set of pre-defined classes, functions, and interfaces that are automatically available in every Kotlin file without needing explicit import statements. These imports provide access to commonly used functionalities, reducing boilerplate code and making development more convenient. They include core language features and essential utilities that are frequently used in Kotlin programs.
Visit the following resources to learn more:
- [@official@Default Imports](https://kotlinlang.org/docs/packages.html#default-imports)
@@ -1 +1,12 @@
# Defining Classes
# Defining Classes
In Kotlin, a class is a blueprint for creating objects (instances). You define a class using the `class` keyword, followed by the class name and curly braces. A class consists of three major parts:
* Properties. Variables that specify the attributes of the class's objects.
* Methods. Functions that contain the class's behaviors and actions.
* Constructors. A special member function that creates instances of the class throughout the program in which it's defined.
Visit the following resources to learn more:
- [@official@Classes](https://kotlinlang.org/docs/classes.html)
- [@article@Define a class](https://developer.android.com/codelabs/basic-android-kotlin-compose-classes-and-objects#1)
- [@video@Kotlin Classes & Objects Explained 🚀 | OOP in Kotlin | Kotlin Crash Course](https://www.youtube.com/watch?v=1WF2Q_UJgps)
@@ -1 +1,3 @@
# Documentation
# Documentation
Kotlin uses KDoc, a documentation generation tool, to create API documentation from comments in your code. These comments, similar to Javadoc, are placed above declarations (classes, functions, properties, etc.) and use a specific syntax to describe the element's purpose, parameters, return values, and other relevant information. Tools like Dokka then process these KDoc comments to generate HTML or other formats of documentation, making your code easier to understand and use by other developers.
@@ -1 +1,9 @@
# Dokka
# Dokka
Dokka is a documentation engine for Kotlin, similar to Javadoc for Java. It generates API documentation in various formats (like HTML, Markdown, and more) from Kotlin source code. Dokka uses KDoc comments within your code to create comprehensive and navigable documentation, making it easier for developers to understand and use your Kotlin libraries and applications.
Visit the following resources to learn more:
- [@official@Dokka](https://kotlinlang.org/docs/dokka-introduction.html)
- [@official@Get started with Dokka](https://kotlinlang.org/docs/dokka-get-started.html)
- [@article@From Code to Clarity: How Dokka Transforms Kotlin and Java Documentation](https://thekaailashsharma.medium.com/dokka-docuemntation-ed08d5e37935)
@@ -1 +1,8 @@
# Enum Class
# Enum Class
An enum class in Kotlin is a special type of class that represents a fixed set of possible values, often called "enumerations". Think of it like a list of named constants. Each constant in the enum class is an instance of that class. They're useful when you need to represent a limited number of choices, like days of the week, directions (North, South, East, West), or status codes (e.g., Success, Pending, Failed).
Visit the following resources to learn more:
- [@official@Enum classes](https://kotlinlang.org/docs/enum-classes.html)
- [@video@Sealed Classes VS. Enum Classes VS. Sealed Interfaces - When to Use Which?](https://www.youtube.com/watch?v=kLJRZpRhX1o)
@@ -1 +1,8 @@
# Exceptions
# Exceptions
Exceptions in Kotlin are a way to handle errors that occur during the execution of a program. When an error happens, an exception object is created and "thrown." This disrupts the normal flow of the program. To handle these exceptions, you can use `try`, `catch`, and `finally` blocks. The `try` block contains the code that might throw an exception. If an exception occurs, the `catch` block that matches the exception type will execute. The `finally` block contains code that will always execute, regardless of whether an exception was thrown or caught, and is often used for cleanup operations.
Visit the following resources to learn more:
- [@official@Exceptions](https://kotlinlang.org/docs/exceptions.html)
- [@video@Kotlin: Beyond the Try/Catch (Exception Handling)](https://www.youtube.com/watch?v=ThlFnnaxsuE)
@@ -1 +1,8 @@
# Extension Functions
# Extension Functions
Extension functions in Kotlin provide a way to add new functions to existing classes without inheriting from them or using any type of design pattern such as Decorator. This is achieved by defining a function that can be called as if it were a member of the class, even though it's defined outside of the class's original declaration. They are declared with a receiver type, which specifies the class to which the extension function is being added.
Visit the following resources to learn more:
- [@official@Extension Functions](https://kotlinlang.org/docs/extensions.html)
- [@video@5 Fun Ways to Use Extension Functions in Kotlin](https://www.youtube.com/watch?v=Q0RYVV9rZBI)
@@ -1 +1,7 @@
# Extension Functions
# Extension Functions
Extension functions in Kotlin provide a way to add new functions to existing classes without inheriting from them or using any type of design pattern such as Decorator. This is achieved by defining a function that can be called as if it were a member of the class, even though it's defined outside of it. Extension functions are resolved statically, meaning the function call is determined by the declared type of the receiver, not its runtime type.
Visit the following resources to learn more:
- [@official@Extension functions](https://kotlinlang.org/docs/extensions.html#extension-functions)
@@ -1 +1,8 @@
# Filtering
# Filtering in Kotlin Collections
Filtering in Kotlin collections involves selecting elements from a collection based on a specific condition. This process creates a new collection containing only the elements that satisfy the given predicate, leaving the original collection unchanged. Kotlin provides various built-in functions to perform filtering operations efficiently and concisely.
Visit the following resources to learn more:
- [@official@Collection Filtering](https://kotlinlang.org/docs/collection-filtering.html)
- [@video@Kotlin For Beginners - Collection Filtering](https://www.youtube.com/watch?v=ZK9_qMxpqvk)
@@ -1 +1,7 @@
# Floats
# Floats in Kotlin
Floats in Kotlin represent single-precision (Float) and double-precision (Double) floating-point numbers, used to store numbers with decimal points. `Float` uses 32 bits of memory, offering a smaller range and precision, while `Double` uses 64 bits, providing a larger range and higher precision. You use them when you need to represent non-integer values like measurements, scientific data, or financial values.
Visit the following resources to learn more:
- [@official@Floating-point types](https://kotlinlang.org/docs/numbers.html#floating-point-types)
@@ -1 +1,8 @@
# for
# Kotlin For Loop
The `for` loop in Kotlin is used to iterate over a range, collection, or any other iterable object. It executes a block of code for each element in the sequence. You can use it to go through numbers in a specific range, items in a list, or characters in a string, performing the same action on each one. The `for` loop simplifies repetitive tasks by automatically handling the iteration process.
Visit the following resources to learn more:
- [@official@For Loops](https://kotlinlang.org/docs/control-flow.html#for-loops)
- [@video@Control Flow | for loop | in, rangeTo, downTo, step, until](https://www.youtube.com/watch?v=ghOI_etcjSk)
@@ -1 +1,9 @@
# Function Types
# Function Types
In Kotlin, functions can be treated as data. A function type represents a specific kind of function, defined by the types of its parameters and its return type. You can assign a function to a variable, pass it as an argument to another function, or return it from a function. This allows for more flexible and dynamic code, enabling you to write higher-order functions and implement functional programming paradigms.
Visit the following resources to learn more:
- [@official@Function types](https://kotlinlang.org/docs/lambdas.html#function-types)
- [@article@Use functions as a data type](https://developer.android.com/codelabs/basic-android-kotlin-compose-function-types-and-lambda#3)
- [@article@Function types](https://kt.academy/article/fk-function-types)
@@ -1 +1,8 @@
# Gradle Pluggins
# Gradle Plugins in Kotlin
Gradle plugins are reusable components that extend Gradle's build capabilities. They automate tasks like compiling code, running tests, and packaging applications. In Kotlin projects, plugins are often written in Kotlin itself, allowing for type-safe build configurations and leveraging Kotlin's features for more expressive and maintainable build scripts. These plugins can be applied to a project to customize the build process and integrate with various tools and libraries.
Visit the following resources to learn more:
- [@official@Configure a Gradle project](https://kotlinlang.org/docs/gradle-configure-project.html)
- [@official@Using Plugins](https://docs.gradle.org/current/userguide/plugins.html)
@@ -1 +1,10 @@
# Gradle
# Gradle
Gradle is an open-source build automation tool known for its flexibility and performance. It's used to automate tasks like compiling, testing, and deploying software. Gradle uses a Domain Specific Language (DSL) based on Groovy or Kotlin to define build scripts, allowing developers to customize the build process extensively. It supports dependency management, allowing projects to easily incorporate external libraries and frameworks.
Visit the following resources to learn more:
- [@official@Gradle](https://kotlinlang.org/docs/gradle.html)
- [@official@Gradle user manual](https://docs.gradle.org/current/userguide/userguide.html)
- [@official@Get started with Gradle and Kotlin/JVM](https://kotlinlang.org/docs/get-started-with-jvm-gradle-project.html)
- [@video@The Ultimate Gradle Kotlin Beginner's Crash Course For 2025](https://www.youtube.com/watch?v=RCRQlz78wCg)
@@ -1 +1,9 @@
# Grouping
# Grouping
Grouping in Kotlin involves organizing elements from a collection into subgroups based on a specific criterion. This operation creates a map where the keys represent the grouping criteria, and the values are lists of elements that satisfy that criteria. It's a way to categorize and structure data within a collection for easier analysis or processing.
Visit the following resources to learn more:
- [@official@Grouping](https://kotlinlang.org/docs/collection-grouping.html)
- [@article@A Comprehensive Guide to Kotlin GroupBy: Mastering Grouping Operations](https://www.dhiwise.com/post/comprehensive-guide-to-kotlin-groupby-mastering-grouping)
- [@video@Collections Grouping | groupBy | groupingBy](https://www.youtube.com/watch?v=iYb_Yu8D4HQ)
@@ -1 +1,9 @@
# Higher-order Functions
# Higher-Order Functions
Higher-order functions in Kotlin are functions that can take other functions as arguments, return functions, or both. This means you can pass a function into another function, treat functions like any other data type (like integers or strings), and even create functions that generate and return new functions. This allows for more flexible and reusable code by abstracting behavior and logic.
Visit the following resources to learn more:
- [@official@Higher-order functions](https://kotlinlang.org/docs/lambdas.html#higher-order-functions)
- [@article@Higher-order functions with collections](https://developer.android.com/codelabs/basic-android-kotlin-compose-higher-order-functions#0)
- [@article@Higher-Order Functions in Kotlin](https://medium.com/@anandgaur2207/higher-order-functions-in-kotlin-b35fc6b23f8e)
@@ -1 +1,8 @@
# History of Kotlin
# History of Kotlin
Kotlin is a modern, statically typed programming language developed by JetBrains. It was initially conceived as a new language for the JVM, aiming to address some of the shortcomings of Java while maintaining full interoperability. The project started in 2010 and was open source from very early on. The first official 1.0 release was in February 2016. The language's design emphasizes conciseness, safety, and versatility, making it suitable for a wide range of applications, including Android development, server-side applications, and more.
Visit the following resources to learn more:
- [@official@10 Years of Kotlin](https://kotlinlang.org/lp/10yearsofkotlin/past/)
- [@article@Kotlin | Wikipedia](https://en.wikipedia.org/wiki/Kotlin_(programming_language))
@@ -1 +1,8 @@
# IDEs
# IDEs
Integrated Development Environments (IDEs) provide developers with tools to write, test, and debug code more efficiently. Popular IDEs for Kotlin development include IntelliJ IDEA, which is developed by JetBrains (the creators of Kotlin) and offers excellent support for the language, including code completion, refactoring, and debugging. Android Studio, also based on IntelliJ IDEA, is the official IDE for Android development and provides specific tools for building Kotlin-based Android applications. Eclipse with the Kotlin plugin is another option, offering a familiar environment for developers already using Eclipse.
Visit the following resources to learn more:
- [@official@IDEs for Kotlin development](https://kotlinlang.org/docs/kotlin-ide.html)
- [@article@What is an IDE (Integrated Development Environment)?](https://.amazon.com/what-is/ide/)
@@ -1 +1,12 @@
# if
# if
To use `if` in Kotlin, add the condition to check within parentheses `()` and the action to take if the result is true within curly braces `{}`. You can use `else` and `else if` for additional branches and checks.
Also, you can also write `if` as an expression, which lets you assign its returned value directly to a variable. In this form, an `else` branch is required. The `if` expression serves the same purpose as the ternary operator (`condition ? then : else`) found in other languages.
Visit the following resources to learn more:
- [@official@https://kotlinlang.org/docs/control-flow.html#if-expression](https://developer.android.com/codelabs/basic-android-kotlin-compose-conditionals#1)
- [@article@Use if/else statements to express conditions](https://developer.android.com/codelabs/basic-android-kotlin-compose-conditionals#1)
- [@article@Use if/else and when as expressions](https://developer.android.com/codelabs/basic-android-kotlin-compose-conditionals#3)
- [@video@Control Flows | if else | when - the cooler switch](https://www.youtube.com/watch?v=Wp2UU4yKjqM)
@@ -1 +1,8 @@
# Importing Packages
# Importing Packages
Packages in Kotlin are namespaces that provide a way to organize and manage code, preventing naming conflicts and improving code reusability. Importing packages allows you to access classes, functions, and other declarations defined within those packages directly, without needing to specify the fully qualified name every time you use them. This simplifies your code and makes it more readable.
Visit the following resources to learn more:
- [@official@Imports](https://kotlinlang.org/docs/packages.html#imports)
- [@video@Exploring Kotlin -Package](https://arunpandianm.medium.com/5-exploring-kotlin-package-2cb8c3e4438a)
@@ -1 +1,9 @@
# Inheritance
# Inheritance in Kotlin
Inheritance in Kotlin allows you to create new classes (child classes or subclasses) based on existing classes (parent classes or superclasses). The child class inherits properties and functions from the parent class, and can also add its own unique properties and functions or override the parent's behavior. This promotes code reuse and establishes a hierarchical relationship between classes, making your code more organized and maintainable.
Visit the following resources to learn more:
- [@official@Inheritance](https://kotlinlang.org/docs/inheritance.html)
- [@article@Implement a relationship between classes](https://developer.android.com/codelabs/basic-android-kotlin-compose-classes-and-objects#6)
- [@video@Kotlin Newbie to Pro - INHERITANCE](https://www.youtube.com/watch?v=Xk3IPNHbLVk)
@@ -1 +1,8 @@
# Inline Class
# Inline Class
An inline class in Kotlin is a special type of class that holds only one property. At runtime, instances of inline classes are represented as the underlying value, avoiding the overhead of object allocation. This allows you to create type-safe wrappers around primitive types or other values without incurring the performance cost of creating a new object.
Visit the following resources to learn more:
- [@official@Inline value classes](https://kotlinlang.org/docs/inline-classes.html#inline-classes.md)
- [@video@Inline functions - Kotlin Vocabulary](https://www.youtube.com/watch?v=wAQCs8-a6mg&list=PLWz5rJ2EKKc_T0fSZc9obnmnWcjvmJdw_)
@@ -1 +1,7 @@
# Integers
# Integers in Kotlin
Integers in Kotlin are whole numbers without any fractional or decimal parts. Kotlin provides several integer types, each differing in the range of values they can represent. These types include `Byte`, `Short`, `Int`, and `Long`. The choice of which type to use depends on the size of the number you need to store; using a smaller type can save memory if the range of possible values is limited. `Int` is the most commonly used integer type, offering a good balance between size and range for most general-purpose calculations.
Visit the following resources to learn more:
- [@article@Integer types](https://kotlinlang.org/docs/numbers.html#integer-types)
@@ -1 +1,9 @@
# IntelliJ IDEA
# IntelliJ IDEA
IntelliJ IDEA is a popular Integrated Development Environment (IDE) specifically designed for software development. It provides a comprehensive suite of tools for coding, debugging, testing, and deploying applications. It offers features like code completion, refactoring, and integration with version control systems, making it a powerful tool for developers to streamline their workflow and improve productivity.
Visit the following resources to learn more:
- [@official@IntelliJ IDEA](https://www.jetbrains.com/idea/)
- [@opensource@IntelliJ IDEA](https://github.com/JetBrains/intellij-community)
- [@video@IntelliJ IDEA Tutorial](https://www.youtube.com/watch?v=XCqVCq249Iw)
@@ -1 +1,8 @@
# Interfaces
# Interfaces
Interfaces in Kotlin are blueprints for classes, defining a set of properties and abstract methods that implementing classes must provide. They allow you to define a contract, ensuring that any class implementing the interface will have specific functionalities. Unlike classes, interfaces cannot store state; they only declare what a class *should* do, not *how* it should do it. A class can implement multiple interfaces, enabling a form of multiple inheritance of behavior.
Visit the following resources to learn more:
- [@official@Interfaces](https://kotlinlang.org/docs/interfaces.html#interfaces.md)
- [@video@What are Kotlin Interfaces Used For and Why?](https://www.youtube.com/watch?v=x_VBFdit6Iw)
@@ -1 +1,11 @@
# Introduction to Kotlin
# Introduction to Kotlin
Kotlin is an open-source statically typed programming language that targets the JVM, Android, JavaScript, Wasm, and Native. Kotlin is an open-source, statically-typed programming language that supports both object-oriented and functional programming. It's designed to be concise, safe, and interoperable with Java, making it easy to adopt for existing Java projects. Kotlin can be used for any kind of development, be it server-side, client-side web, Android, or multiplatform library. With Kotlin/Native currently in the works, support for other platforms such as embedded systems, macOS, and iOS. People are using Kotlin for mobile and server-side applications, client-side with JavaScript or JavaFX, and data science, just to name a few possibilities.
Visit the following resources to learn more:
- [@official@Kotlin Docs](https://kotlinlang.org/docs/home.html)
- [@article@Kotlin overview](https://developer.android.com/kotlin/overview)
- [@official@Teach Computer Science with Kotlin](https://kotlinlang.org/education/)
- [@course@Android Basics with Compose](https://developer.android.com/courses/android-basics-compose/course)
- [@video@Full 2025 Kotlin Crash Course For Beginners](https://www.youtube.com/watch?v=dzUc9vrsldM)
@@ -1 +1,10 @@
# I/O Library
# I/O Library
Kotlin leverages both its own `kotlin.io` package and the standard Java `java.io` package for input and output operations. `kotlin.io` provides a set of extension functions and utilities that simplify common I/O tasks, offering a more Kotlin-idiomatic way to interact with files, streams, and the console. While `kotlin.io` offers convenient abstractions, `java.io` remains fully accessible and usable within Kotlin code, providing a broader range of classes and functionalities for more complex I/O scenarios.
Visit the following resources to learn more:
- [@official@kotlin.io](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.io/)
- [@opensource@kotlinx.io](https://github.com/Kotlin/kotlinx-io)
- [@official@java.io](https://docs.oracle.com/javase/tutorial/essential/io/)
- [@video@Working With Files In Kotlin - IO Essentials](https://www.youtube.com/watch?v=MSeI7XVzrvo)
@@ -1 +1,8 @@
# I/O
# I/O in Kotlin
Input/Output (I/O) in Kotlin refers to how a program interacts with the outside world. This involves reading data from sources like files, the keyboard, or network connections, and writing data to destinations such as files, the console, or network sockets. Kotlin leverages Java's extensive I/O libraries, providing classes and functions for handling various input and output operations. These operations allow programs to receive data, process it, and then present or store the results.
Visit the following resources to learn more:
- [@official@kotlin.io](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.io/)
- [@video@Working With Files In Kotlin - IO Essentials](https://www.youtube.com/watch?v=MSeI7XVzrvo)
@@ -1 +1,10 @@
# Iterators
# Iterators
Iterators are objects that allow you to traverse through the elements of a collection (like a list or a set) one by one. They provide a way to access each item in the collection sequentially without needing to know the underlying structure of the collection. You can use iterators to read the elements, and in some cases, to remove elements from the collection as you iterate.
Visit the following resources to learn more:
- [@official@Iterators](https://kotlinlang.org/docs/iterators.html)
- [@official@Iterator](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterator/)
- [@article@Mastering Kotlin Iterators: A Complete Guide For Developers](https://www.dhiwise.com/post/mastering-kotlin-iterators-a-complete-guide-for-developers)
- [@video@Iterating Collections | for | forEach | Iterator](https://www.youtube.com/watch?v=MXRNAw6Uem0)
@@ -1 +1,7 @@
# Java from Kotlin
# Java Interoperability from Kotlin
Kotlin is designed to be fully interoperable with Java, meaning you can seamlessly use existing Java code within your Kotlin projects. This allows you to leverage existing Java libraries, frameworks, and codebases without needing to rewrite them in Kotlin. You can call Java code directly from Kotlin, accessing classes, methods, and fields as if they were written in Kotlin.
Visit the following resources to learn more:
- [@official@Calling Java from Kotlin](https://kotlinlang.org/docs/java-interop.html)
@@ -1 +1,9 @@
# Java Interoperability
# Java Interoperability
Kotlin is 100% interoperable with the Java programming language, and major emphasis has been placed on making sure that your existing codebase can interact properly with Kotlin. You can easily call Kotlin code from Java and Java code from Kotlin. This makes adoption much easier and lower-risk. There's also an automated Java-to-Kotlin converter built into the IDE that simplifies migration of existing code.
Visit the following resources to learn more:
- [@official@Kotlin Comparison to Java](https://kotlinlang.org/docs/comparison-to-java.html)
- [@official@Calling Java from Kotlin](https://kotlinlang.org/docs/java-interop.html)
- [@official@Calling Kotlin from Java](https://kotlinlang.org/docs/java-to-kotlin-interop.html)
@@ -1 +1,8 @@
# JVM Metadata
# JVM Metadata
The `kotlin-metadata-jvm` library provides tools to read, modify, and generate metadata from Kotlin classes compiled for the JVM. This metadata, stored in the `@Metadata` annotation within `.class` files, is used by libraries and tools such as `kotlin-reflect` to inspect Kotlin-specific constructs such as properties, functions, and classes at runtime.
Visit the following resources to learn more:
- [@official@Kotlin Metadata JVM library](https://kotlinlang.org/docs/metadata-jvm.html)
- [@official@kotlin-metadata-jvm](https://kotlinlang.org/api/kotlinx-metadata-jvm/)
@@ -1 +1,9 @@
# Kandy
# Kotlin Kandy
Kandy is a Kotlin library designed for creating visualizations and performing data analysis. It provides a concise and expressive API for generating plots and charts directly from Kotlin code. Kandy simplifies the process of exploring and presenting data insights, allowing developers to create visually appealing and informative graphics without needing extensive knowledge of specialized plotting tools.
Visit the following resources to learn more:
- [@official@Kandy Overview](https://kotlin.github.io/kandy/overview.html)
- [@opensource@Kandy](https://github.com/Kotlin/kandy)
- [@video@Kotlin for Data Analysis: Exploring Dataframes and Visualizations in Notebooks](https://www.youtube.com/watch?v=PIxGmHjTdu8)
@@ -1 +1,8 @@
# KDoc
# KDoc
KDoc is Kotlin's documentation generation tool, similar to Javadoc for Java. It allows developers to embed documentation directly within their code, using a specific syntax to describe classes, functions, properties, and other elements. This documentation can then be extracted and formatted into a readable, navigable website or other documentation formats, providing a clear and accessible reference for users of the code.
Visit the following resources to learn more:
- [@official@Document Kotlin code: KDoc](https://kotlinlang.org/docs/kotlin-doc.html)
- [@article@KDoc for Kotlin Documentation — Clean Code Comments](https://nameisjayant.medium.com/kdoc-for-kotlin-documentation-clean-code-comments-bfcec73ad237)
@@ -1 +1,10 @@
# Koog
# Koog
Koog is a Kotlin library designed to simplify the development of AI applications. It provides tools and abstractions for tasks such as neural network creation, training, and inference. Koog aims to make AI development more accessible and efficient within the Kotlin ecosystem by offering a high-level API and leveraging Kotlin's features for concise and expressive code.
Visit the following resources to learn more:
- [@official@Koog Overview](https://docs.koog.ai/)
- [@opensource@Koog](https://github.com/JetBrains/koog)
- [@video@Kickstarting AI Agent Development in Kotlin With Koog](https://www.youtube.com/watch?v=vysVNg4IuUo)
- [@video@Building AI Agents in Kotlin with Koog | Vadim Briliantov](https://www.youtube.com/watch?v=O8WQCrdza8E)
@@ -1 +1,9 @@
# Kotlin DataFrame
# Kotlin DataFrame
Kotlin DataFrame is a library designed for in-memory data manipulation and analysis. It provides a tabular data structure, similar to data frames in R or Python's Pandas, allowing you to organize data into columns of different types. This library offers functionalities for filtering, transforming, aggregating, and joining data, making it easier to perform complex data analysis tasks directly within Kotlin applications.
Visit the following resources to learn more:
- [@official@Kotlin DataFrame](https://kotlin.github.io/dataframe/home.html)
- [@opensource@DataFrame](https://github.com/Kotlin/dataframe)
- [@video@Kotlin DataFrame Overview | Data Science with Kotlin](https://www.youtube.com/watch?v=qGou8F2asNw)
@@ -1 +1,7 @@
# Kotlin from Java
# Kotlin from Java
Kotlin from Java refers to the process of using Kotlin code within existing Java projects. It allows developers to gradually introduce Kotlin into their codebase without requiring a complete rewrite. This interoperability enables leveraging the benefits of Kotlin, such as its concise syntax and null safety features, while still maintaining compatibility with existing Java libraries and frameworks.
Visit the following resources to learn more:
- [@official@Calling Kotlin from Java](https://kotlinlang.org/docs/java-to-kotlin-interop.html)
@@ -1 +1,9 @@
# Kotlin Libraries
# Kotlin Libraries
Kotlin benefits from a rich ecosystem of libraries, both those specifically designed for Kotlin and those written in Java. This interoperability allows Kotlin developers to seamlessly use existing Java libraries. Additionally, Kotlin offers its own set of libraries, often referred to as KLibs, which provide functionalities ranging from standard data structures and algorithms to more specialized tools for tasks like serialization, coroutines, and testing.
Visit the following resources to learn more:
- [@official@Kotlin libraries](https://kotlinlang.org/docs/kotlin-tour-intermediate-libraries-and-apis.html#kotlin-libraries)
- [@official@Klibs](https://klibs.io/)
- [@official@Calling Java from Kotlin](https://kotlinlang.org/docs/java-interop.html#how-to-enable-java-synthetic-property-references)
@@ -1 +1,9 @@
# Kotlin Multiplatform
# Kotlin Multiplatform
Kotlin Multiplatform (KMP) is a feature of the Kotlin programming language that allows developers to write code that can be shared across multiple platforms, such as Android, iOS, JVM, JavaScript, and Native. This means you can write common business logic, data models, and algorithms once in Kotlin and then reuse them in different applications targeting different operating systems and environments, reducing code duplication and development time.
Visit the following resources to learn more:
- [@official@Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html)
- [@article@Kotlin Multiplatform Overview](https://developer.android.com/kotlin/multiplatform)
- [@video@What Is Kotlin Multiplatform And How Does It Work?](https://www.youtube.com/watch?v=RSBO1C_Du2U)
@@ -1 +1,9 @@
# Kotlin Notebooks
# Kotlin Notebooks
Kotlin Notebooks provide an interactive environment for writing and executing Kotlin code, often within a web browser. They allow you to combine code, text, and visualizations in a single document, making them ideal for exploring data, prototyping ideas, and creating shareable reports. This interactive approach facilitates experimentation and iterative development, allowing you to see the results of your code changes immediately.
Visit the following resources to learn more:
- [@official@Kotlin Notebook](https://kotlinlang.org/docs/kotlin-notebook-overview.html)
- [@official@Get started with Kotlin Notebook](https://kotlinlang.org/docs/get-started-with-kotlin-notebooks.html)
- [@video@10:00 YouTube · Kotlin by JetBrains Kotlin Notebook: Visual, Interactive, Fun](https://www.youtube.com/watch?v=m4Cqz2_P9rI)
@@ -1 +1,8 @@
# Kotlin Scripting
# Kotlin Scripting
Kotlin Scripting allows you to use Kotlin as a scripting language. This means you can write Kotlin code that can be executed directly, without the need for a full-fledged application setup. It's useful for automating tasks, creating build scripts, or embedding custom logic into applications.
Visit the following resources to learn more:
- [@official@Get started with Kotlin custom scripting – tutorial](https://kotlinlang.org/docs/custom-script-deps-tutorial.html)
- [@article@State of Kotlin Scripting 2024](https://blog.jetbrains.com/kotlin/2024/11/state-of-kotlin-scripting-2024/)
@@ -1 +1,9 @@
# Kotline Notebook
# Kotlin Notebook
Kotlin Notebook is an interactive environment for writing and executing Kotlin code, similar to Jupyter Notebook for Python. It allows you to combine code, text, and visualizations in a single document, making it ideal for data exploration, prototyping, and creating interactive tutorials. You can execute code snippets (cells) individually and see the results immediately, facilitating experimentation and rapid development.
Visit the following resources to learn more:
- [@official@Kotline Notebook](https://kotlinlang.org/docs/kotlin-notebook-overview.html)
- [@official@Create your first Kotlin Notebook](https://kotlinlang.org/docs/kotlin-notebook-create.html)
- [@video@Kotlin Notebook: Visual, Interactive, Fun | Kotlin Notebook Tutorial](https://www.youtube.com/watch?v=m4Cqz2_P9rI)
@@ -1 +1,9 @@
# Kotlin/Java
# Kotlin/Java
Kotlin/Java allows Kotlin code to seamlessly interact with Java code and libraries. This interoperability means you can use existing Java code in your Kotlin projects and vice versa. It leverages the Java Virtual Machine (JVM) to run both Kotlin and Java code, enabling developers to gradually migrate Java projects to Kotlin or use Kotlin for new features in existing Java applications.
Visit the following resources to learn more:
- [@official@Get started with Kotlin/JVM](https://kotlinlang.org/docs/jvm-get-started.html)
- [@official@Mixing Java and Kotlin in one project – tutorial](https://kotlinlang.org/docs/mixing-java-kotlin-intellij.html)
- [@video@Kotlin For Java Developers Complete Course](https://www.youtube.com/watch?v=dMyRywABp_c)
@@ -1 +1,8 @@
# Kotlin/JavaScript
# Kotlin/JavaScript
Kotlin/JavaScript (Kotlin/JS) allows you to compile Kotlin code into JavaScript. This enables you to use Kotlin to develop web applications, Node.js applications, and other JavaScript-based projects. The resulting JavaScript code can then be executed in any environment that supports JavaScript, such as web browsers or Node.js runtimes. Kotlin/JavaScript can also be used through the Kotlin Multiplatform Gradle plugin
Visit the following resources to learn more:
- [@official@Kotlin/JavaScript](https://kotlinlang.org/docs/js-overview.html)
- [@video@Let's Learn Kotlin/JS! (with Sebastian Aigner)](https://www.youtube.com/watch?v=_kM9Y6C0iRI)
@@ -1 +1,8 @@
# Kotlin/Native
# Kotlin/Native
Kotlin/Native is a technology for compiling Kotlin code to native binaries, which can run without a virtual machine. This allows Kotlin to be used for developing applications for platforms where a JVM is not suitable or available, such as embedded systems, iOS, macOS, Windows, Linux, and WebAssembly. It achieves this by using the LLVM compiler infrastructure to translate Kotlin code into machine code.
Visit the following resources to learn more:
- [@official@Kotlin/Native](https://kotlinlang.org/docs/native-overview.html)
- [@official@Get started with Kotlin/Native](https://kotlinlang.org/docs/native-get-started.html)
@@ -1 +1,9 @@
# Kotlin/WASM
# Kotlin/WASM
Kotlin/WASM allows you to compile Kotlin code to WebAssembly (WASM), a binary instruction format designed for efficient execution in web browsers and other environments. This enables Kotlin developers to build high-performance applications that can run directly in the browser, leveraging Kotlin's features and tooling for web development. It provides an alternative to JavaScript for client-side web development, and also opens up possibilities for using Kotlin in other WASM-compatible environments.
Visit the following resources to learn more:
- [@official@Kotlin/Wasm](https://kotlinlang.org/docs/wasm-overview.html)
- [@official@Get started with Kotlin/Wasm and Compose Multiplatform](https://kotlinlang.org/docs/wasm-get-started.html)
- [@video@Kotlin and WebAssembly: Unleashing Cross-Platform Power](https://www.youtube.com/watch?v=t3FUWfJWrjU)
@@ -1 +1,10 @@
# Ktor
# Ktor
Ktor is a framework for building asynchronous server-side applications, client applications, and more, in connected systems. It's built using Kotlin and coroutines, providing a simple and efficient way to handle concurrency and build scalable network applications. Ktor allows developers to create web applications, HTTP APIs, microservices, and other networked applications with ease.
Visit the following resources to learn more:
- [@official@ktor Docs](https://ktor.io/docs/welcome.html)
- [@opensource@ktor](https://github.com/ktorio/ktor)
- [@video@Managing Complexity With Ktor | Garth Gilmour](https://www.youtube.com/watch?v=RiNRQNLcpj8)
- [@video@Ktor Server Fundamentals](https://www.youtube.com/playlist?list=PL3_Xm4wcQKw1DCU1lPSVhuCMYHg-pLVKI)
@@ -1 +1,7 @@
# Label Loops
# Label Loops
Label loops in Kotlin allow you to control which loop is exited or continued when using `break` or `continue` statements within nested loops. By assigning a label (an identifier followed by `@`) to a loop, you can specify which loop the `break` or `continue` statement should affect. This is particularly useful when you want to exit or continue an outer loop from within an inner loop, providing more precise control over the flow of execution.
Visit the following resources to learn more:
- [@official@Returns and jumps](https://kotlinlang.org/docs/returns.html)
@@ -1 +1,10 @@
# Lambda Functions
# Lambda Functions
Lambda functions in Kotlin are essentially nameless functions that you can treat like values. Think of them as mini-functions you can pass around, store in variables, or execute directly. They're defined using curly braces `{}` and can take parameters and return a value. They're particularly useful for short, concise operations, especially when working with collections or higher-order functions (functions that take other functions as arguments).
Visit the following resources to learn more:
- [@official@Lambda expressions and anonymous functions](https://kotlinlang.org/docs/lambdas.html#lambda-expressions-and-anonymous-functions)
- [@article@Kotlin Lambda Functions](https://medium.com/@guruprasadhegde4/kotlin-lambda-expressions-bb9d4e15b6fc)
- [@video@How to Use Simple Lambda Expressions in Kotlin](https://www.youtube.com/watch?v=unCjOegBSMI)
- [@video@Introduction to Lambdas](https://www.youtube.com/watch?v=S6oJgF_J9m4)
@@ -1 +1,8 @@
# Lists
# Lists in Kotlin
Lists in Kotlin are ordered collections of items. They can contain elements of the same type, and you can access these elements by their index (position) in the list. Kotlin provides both mutable (changeable) and immutable (read-only) lists, allowing you to choose the appropriate type based on whether you need to modify the list after its creation.
Visit the following resources to learn more:
- [@official@Lists](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/)
- [@article@Lists | Android](https://developer.android.com/codelabs/basic-android-kotlin-collections#2)
@@ -1 +1,8 @@
# Lists
# List Operations in Kotlin
Kotlin lists offer several operations beyond the general collection operations. These include accessing elements by index (using `get()` or the `[]` operator), adding or removing elements at specific positions (using `add()` or `removeAt()`), and finding the index of a particular element (using `indexOf()` or `lastIndexOf()`). Lists also support operations for sublisting (using `subList()`) and replacing elements at a given index (using `set()`). These operations are available for both mutable and immutable lists, with mutable lists allowing modifications to the list's content.
Visit the following resources to learn more:
- [@official@List-specific operations](https://kotlinlang.org/docs/list-operations.html#retrieve-list-parts)
- [@article@How To Use List In Kotlin](https://medium.com/@ajay_00/how-to-use-list-in-kotlin-ca9544df54c4)
@@ -1 +1,7 @@
# Local Functions
# Local Functions
Local functions in Kotlin are functions defined inside another function. They provide a way to organize and reuse code within a specific function's scope. This means a local function can only be called from within the function it's defined in, and it has access to the outer function's variables. They are useful for breaking down complex functions into smaller, more manageable parts, improving readability and maintainability.
Visit the following resources to learn more:
- [@official@Function scope](https://kotlinlang.org/docs/functions.html#function-scope)
@@ -1 +1,10 @@
# Loops
# Loops in Kotlin
Loops in Kotlin are used to execute a block of code repeatedly. They provide a way to automate repetitive tasks. Kotlin offers several types of loops, including `for` loops (for iterating over collections or ranges) and `while` loops (for executing a block as long as a condition is true), and `do-while` loops (similar to `while` and `do-while` loops. These loops help in efficiently processing data and controlling the flow of execution in your programs.
Visit the following resources to learn more:
- [@official@For Loops](https://kotlinlang.org/docs/control-flow.html#for-loops)
- [@official@While Loops](https://kotlinlang.org/docs/control-flow.html#while-loops)
- [@article@Kotlin Loops](https://www.codecademy.com/resources/docs/kotlin/loops)
- [@video@How to Improve Loops in Kotlin](https://www.youtube.com/watch?v=i-kyPp1qFBA)
@@ -1 +1,8 @@
# main Function
# Main Function
The `main` function serves as the entry point for a Kotlin program. When you execute a Kotlin application, the code within the `main` function is the first to be run. It's where the program's execution begins, and it typically orchestrates the overall flow and logic of the application.
Visit the following resources to learn more:
- [@official@Program Entry point](https://kotlinlang.org/docs/basic-syntax.html#program-entry-point)
- [@article@Kotlin Syntax](https://www.w3schools.com/kotlin/kotlin_syntax.php)
@@ -1 +1,8 @@
# Maps
# Maps in Kotlin
Maps are data structures that store collections of key-value pairs, where each key is unique. They allow you to efficiently retrieve a value based on its associated key. Think of them like dictionaries where you look up a word (the key) to find its definition (the value). Kotlin provides built-in support for maps, offering both mutable and immutable versions.
Visit the following resources to learn more:
- [@official@Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/)
- [@article@Map Collection | Android](https://developer.android.com/codelabs/basic-android-kotlin-collections#4)
@@ -1 +1,8 @@
# Maps
# Maps
Maps in Kotlin are collections that hold key-value pairs. Map-specific operations allow you to interact with these pairs in targeted ways. These operations include retrieving values based on their keys, adding new key-value pairs, removing pairs, checking if a key or value exists, and iterating through the map's entries, keys, or values. These operations provide efficient ways to manage and manipulate data stored in a map structure.
Visit the following resources to learn more:
- [@official@Map-specific operations](https://kotlinlang.org/docs/map-operations.html)
- [@video@Map Explained - Kotlin Collections](https://www.youtube.com/watch?v=ff8uuCHtiZ8)
@@ -1 +1,9 @@
# Maven
# Maven
Maven is a powerful build automation tool primarily used for Java projects, but it also works seamlessly with Kotlin. It simplifies dependency management by allowing you to declare external libraries your project needs, and Maven automatically downloads and includes them. Maven uses a Project Object Model (POM) file, typically named `pom.xml`, to describe the project's configuration, dependencies, and build process, making project builds consistent and reproducible across different environments.
Visit the following resources to learn more:
- [@official@Maven](https://kotlinlang.org/docs/maven.html)
- [@official@Apache Maven](https://maven.apache.org/)
- [@video@How to Add Kotlin to a Java Project with Maven](https://www.youtube.com/watch?v=4-qOxvjjF8g)
@@ -1 +1,10 @@
# Member Functions
# Member Functions
Member functions, also known as methods, are functions that are defined inside a class. They operate on the data of that class and can access its properties. You can think of them as actions that an object of that class can perform. They are declared using the `fun` keyword within the class body, just like regular functions, but they are associated with a specific class. Member functions are called with dot notation:
`
Sample().foo() // creates instance of class Sample and calls foo
`
Visit the following resources to learn more:
- [@official@Member functions](https://kotlinlang.org/docs/functions.html#member-functions)
@@ -1 +1,8 @@
# Methods
# Methods in Kotlin Classes
Methods in Kotlin classes are functions defined within the class that operate on the class's data (properties). They define the behavior of objects created from the class. Methods can perform actions, manipulate data, and return values. They are accessed using the dot notation on an object instance of the class.
Visit the following resources to learn more:
- [@official@Member functions](https://kotlinlang.org/docs/functions.html#member-functions)
- [@article@Define class methods](https://developer.android.com/codelabs/basic-android-kotlin-compose-classes-and-objects#3)
@@ -1 +1,10 @@
# Nested & Inner Classes
# Nested & Inner Classes
Kotlin allows you to define classes inside other classes. A nested class is declared inside another class but doesn't have access to the outer class's instance. An inner class, on the other hand, is declared with the `inner` keyword and *does* have access to the outer class's instance members. This provides a way to logically group classes and control access to data.
Visit the following resources to learn more:
- [@official@Nested and inner classes](https://kotlinlang.org/docs/nested-classes.html)
- [@article@Understanding Nested and Inner Classes in Kotlin](https://medium.com/@sandeepkella23/understanding-nested-and-inner-classes-in-kotlin-ae1c4d699053)
- [@video@Kotlin Nested Classes](https://www.youtube.com/watch?v=duTShX-EL5w)
- [@video@Kotlin Inner Classes](https://www.youtube.com/watch?v=L3pAmeYjrp8)
@@ -1 +1,8 @@
# Nullability Check Operators
# Nullability Check Operators
Nullability check operators in Kotlin are tools that allow you to safely handle variables that might contain null values. They provide a concise way to access properties or call methods on nullable variables, preventing `NullPointerException` errors at runtime. These operators include the safe call operator (`?.`), the Elvis operator (`?:`), and the not-null assertion operator (`!!`). They enable developers to write more robust and readable code when dealing with potentially null data.
Visit the following resources to learn more:
- [@official@Null safety](https://kotlinlang.org/docs/null-safety.html)
- [@video@Kotlin NULL Safe Operators | Best Explanation Ever | Elvis Operator and Non Null Assertion Operators](https://www.youtube.com/watch?v=fxQbpy-s3Bw)

Some files were not shown because too many files have changed in this diff Show More