Kotlin is a modern, statically typed programming language developed by JetBrains and first released in 2016.
Kotlin is easy to learn, especially if you already know Java, as it is fully compatible with Java.
Kotlin is used to develop Android apps, server-side applications, and much more.
Google officially supports Kotlin for Android development, and many developers prefer it for building Android apps.
Kotlin Tutorial
- What is Kotlin?
- Setting Up Environment for Kotlin
- Your First Kotlin Program
- Structure of the Kotlin Program
- Kotlin Comments
- Kotlin Data Types
- Kotlin Type Conversion
- Kotlin Operators
- Kotlin Arithmetic Operators
- Kotlin Relational Operators
- Kotlin Assignment Operators
- Kotlin Logical Operators
- Kotlin Bitwise Operators
Kotlin Control Flow Statements
- Kotlin Control Flow Statements
- Kotlin if Statement
- Kotlin when Statement
- Kotlin for Loop
- Kotlin while Loop
- Kotlin do-while Loop
- Kotlin break Statement
- Kotlin continue Statement
- Kotlin Ranges
Kotlin Functions
Kotlin Arrays and Strings
Kotlin OOPs
- Kotlin Object-Oriented Programming (OOP)
- Kotlin Classes and Objects
- Kotlin Constructors
- Kotlin Visibility Modifiers
- Kotlin Encapsulation
- Kotlin Inheritance
- Kotlin Interfaces
- Kotlin Abstract Classes and Methods
- Kotlin Data Classes
- Kotlin Sealed Classes
- Kotlin Abstraction
- Kotlin Polymorphism
Kotlin Exception Handling
- Kotlin Exception Handling
- Kotlin Try Catch
- Kotlin finally Block
- Kotlin throw Keyword
- Kotlin Custom Exceptions
Kotlin Collections and Generics
150+ Guides to Koltin Built-in Functions
Guides to Kotlin Types and Classes
Kotlin Standard Library – Types and Classes
Class/Interface | Description |
---|---|
Kotlin Any | The root of the Kotlin class hierarchy. |
Kotlin Array Class | Represents an array of elements. |
Kotlin ArrayIndexOutOfBoundsException | Thrown to indicate that an array has been accessed with an illegal index. |
Kotlin AutoCloseable | A resource that must be closed when it is no longer needed. |
Kotlin Boolean Class | Represents a value that can be either true or false. |
Kotlin Byte Class | Represents an 8-bit signed integer. |
Kotlin Char Class | Represents a 16-bit Unicode character. |
Kotlin Comparable Interface | Defines a natural ordering for objects of the implementing class. |
Kotlin Comparator Interface | Compares two objects to impose a total ordering. |
Kotlin Enum Class | Represents a group of named constants. |
Kotlin Int | Represents a 32-bit signed integer. |
Kotlin Long | Represents a 64-bit signed integer. |
Kotlin Nothing | Represents a value that never exists. |
Kotlin Number Class | Represents a numeric value. |
Kotlin OutOfMemoryError | Thrown when the JVM runs out of memory. |
Kotlin Pair Class | Represents a pair of values. |
Kotlin Short | Represents a 16-bit signed integer. |
Kotlin String Class | Represents a sequence of characters. |
Kotlin Throwable Class | The superclass of all errors and exceptions. |
Kotlin Triple Class | Represents a triple of values. |
Kotlin Unit Class | Represents the lack of a value. |
Kotlin Exception Package – Types and Classes
Class/Interface | Description |
---|---|
Kotlin ArithmeticException | Thrown when an exceptional arithmetic condition has occurred. |
Kotlin ClassCastException | Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. |
Kotlin ConcurrentModificationException | Thrown when a collection has been modified concurrently but not permitted by the collection. |
Kotlin IllegalArgumentException | Thrown to indicate that a method has been passed an illegal or inappropriate argument. |
Kotlin IllegalStateException | Signals that a method has been invoked at an illegal or inappropriate time. |
Kotlin IndexOutOfBoundsException | Thrown to indicate that an index of some sort is out of range. |
Kotlin KotlinNullPointerException | Thrown when a null reference is illegally accessed. |
Kotlin NoSuchElementException | Thrown by various accessor methods to indicate that the element being requested does not exist. |
Kotlin NotImplementedError | Thrown when a requested operation is not implemented. |
Kotlin NullPointerException | Thrown when an application attempts to use null where an object is required. |
Kotlin NumberFormatException | Thrown to indicate that a string could not be parsed as a number. |
Kotlin RuntimeException | A runtime exception that is thrown to indicate that an error has occurred during the program’s execution. |
Kotlin TypeCastException | Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. |
Kotlin Annotations
Annotation | Description |
---|---|
Kotlin @Deprecated Annotation | Marks the annotated declaration as deprecated. |
Kotlin @JvmField | Marks the field as a JVM field, exposing it as a field in the bytecode. |
Kotlin @JvmStatic | Marks the method as static in the bytecode. |
Kotlin @JvmOverloads | Generates overloads for a function, allowing it to be called with fewer arguments. |
Kotlin @JvmName | Specifies the name for a Kotlin function or property in the bytecode. |
Kotlin @Suppress | Suppresses compiler warnings for the annotated element. |
Kotlin @UnsafeVariance | Allows variance annotations to be used in otherwise illegal positions. |
Kotlin Collections Package – Types and Classes
Class/Interface | Description |
---|---|
Kotlin ArrayDeque Class | Represents a double-ended queue (deque). |
Kotlin ArrayList Class | Represents a resizable array. |
Kotlin BooleanIterator Class | An iterator over a sequence of Boolean values. |
Kotlin ByteIterator Class | An iterator over a sequence of Byte values. |
Kotlin CharIterator Class | An iterator over a sequence of Char values. |
Kotlin Collection Interface | Represents a group of objects. |
Kotlin HashMap Class | Represents a hash table implementation of the Map interface. |
Kotlin HashSet Class | Represents a hash table implementation of the Set interface. |
Kotlin IntIterator Class | An iterator over a sequence of Int values. |
Kotlin IndexedValue Class | Represents a value with an index. |
Kotlin Iterable Interface | Represents a collection of objects that can be iterated over. |
Kotlin Iterator Interface | An iterator over a sequence of values. |
Kotlin LinkedHashMap Class | Represents a hash table and linked list implementation of the Map interface. |
Kotlin LinkedHashSet Class | Represents a hash table and linked list implementation of the Set interface. |
Kotlin List Interface | Represents an ordered collection of elements. |
Kotlin ListIterator Interface | An iterator over a list of elements, allowing traversal in both directions. |
Kotlin LongIterator Class | An iterator over a sequence of Long values. |
Kotlin MutableList | Represents a list with mutable operations. |
Kotlin Map Interface | Represents a collection of key-value pairs. |
Kotlin MutableMap | Represents a map with mutable operations. |
Kotlin MutableSet Interface | Represents a set with mutable operations. |
Kotlin Set Interface | Represents a collection of unique elements. |
Kotlin SortedMap Interface | Represents a map that maintains order among its elements. |
Kotlin SortedSet Interface | Represents a set that maintains order among its elements. |
Kotlin Vector Class | Represents a dynamic array that can grow as needed. |
Kotlin Utilities
Class/Interface | Description |
---|---|
Kotlin Regex | Represents a regular expression for pattern matching. |
Kotlin Range | Represents a range of values. |
Kotlin Progression | Represents a progression of values with a step. |
Kotlin Sequence | Represents a sequence of elements that can be iterated. |
Kotlin StringBuilder | Represents a mutable sequence of characters. |
Kotlin Duration | Represents a time-based amount of time. |