Useful Links
Computer Science
Programming
By Language
Kotlin Programming
1. Introduction to Kotlin
2. Kotlin Basics and Syntax
3. Functions and Lambdas
4. Object-Oriented Programming in Kotlin
5. Advanced Language Features
6. The Kotlin Standard Library
7. Concurrency with Coroutines
8. Kotlin Multiplatform
9. Practical Kotlin Development
Kotlin Basics and Syntax
Writing Your First Kotlin Program
Structure of a Kotlin File
The `main` Function
Printing Output with `println()`
Compiling and Running Kotlin Code
Understanding Compilation Process
Variables and Data Types
Declaring Variables
Immutable Variables (`val`)
Mutable Variables (`var`)
Variable Naming Conventions
Basic Data Types
Numeric Types
Int
Long
Float
Double
Byte
Short
Unsigned Types
Boolean Type
Character Type
String Type
String Literals
String Templates
Multiline Strings
Raw Strings
Type Inference
Explicit Type Declarations
Type Conversion and Casting
Safe Casts (`as?`)
Unsafe Casts (`as`)
Smart Casts
Type Checks (`is` and `!is`)
Constants
Compile-Time Constants (`const`)
Runtime Constants
Operators
Arithmetic Operators
Comparison Operators
Equality Operators
Logical Operators
Assignment Operators
Increment and Decrement Operators
The `in` Operator
Range Operators
Operator Precedence
Operator Overloading Introduction
Null Safety
Nullable Types (`?`)
Non-Null Types
Safe Calls (`?.`)
The Elvis Operator (`?:`)
Not-Null Assertion Operator (`!!`)
Safe Casts (`as?`)
Null Checks and Smart Casts
Platform Types
Control Flow
Conditional Expressions
`if-else` Statements
`if-else` as an Expression
Nested Conditionals
`when` Expressions
`when` as a Statement
`when` as an Expression
Using `when` without an Argument
Ranges and Type Checks in `when`
Multiple Conditions
Loops
`for` Loops
Iterating over Ranges
Iterating over Collections
Iterating with Indices
`while` Loops
`do-while` Loops
Ranges
Creating Ranges
Stepping and Reversing Ranges
Range Types
Breaking and Continuing Loops
`break` and `continue`
Labeled `break` and `continue`
Nested Loops and Labels
Return and Jump Expressions
Comments and Documentation
Single-Line Comments
Multi-Line Comments
KDoc Documentation
Documentation Tags
Previous
1. Introduction to Kotlin
Go to top
Next
3. Functions and Lambdas