Kotlin is a statically typed programming language that runs on the Java Virtual Machine (JVM). It was developed by JetBrains and is now an official language for Android development. Kotlin is designed to be concise, expressive, and safe. It is also interoperable with Java, which means that you can use Kotlin and Java code together in the same project.
Overview about the Lesson
In this lesson, you will learn the basics of Kotlin programming language. You will learn about data types, operators, variables, control structures, and nullable versus non-nullable variables. You will also learn how to work with the Kotlin REPL (Read-Eval-Print Loop) interactive shell.






The Content of the Lesson
The lesson is divided into two parts. In the first part, you will learn about the basic syntax of Kotlin code. In the second part, you will learn how to install the Java Development Kit (JDK) and the IntelliJ IDEA, and become familiar with some Kotlin features.
Why This Lesson
This lesson is designed for programmers who are new to Kotlin and want to learn the basics of the language. It is also suitable for programmers who are familiar with Java and want to learn Kotlin.
Getting Started with Kotlin: Your First Program
Before opening the PDF, let’s get Kotlin running and write a first program, so every example in the course can be tried as you read.
Three ways to run Kotlin
| Option | Best for | How |
|---|---|---|
| Kotlin Playground | Trying code instantly, no install | Open play.kotlinlang.org in your browser |
| IntelliJ IDEA (Community, free) | Learning and real projects | Install IntelliJ IDEA, then New Project › Kotlin |
| Android Studio | Android apps | Install Android Studio; Kotlin is the default language |
IntelliJ IDEA bundles the Kotlin plugin and can download a JDK for you during project setup, so a separate Java install is usually not needed.
Your first Kotlin program
fun main() {
println("Hello, Kotlin!")
}Output:
Hello, Kotlin!What each part means:
fundeclares a function.mainis the entry point: the program starts here.- The curly braces
{ }contain the function’s body. println()prints text and moves to a new line.
Unlike Java, there is no class wrapper, no public static void and no semicolons at the end of lines.
A slightly bigger example
fun main() {
val name = "Sara"
val year = 2026
println("Hi $name, welcome to Kotlin in $year!")
}Output: Hi Sara, welcome to Kotlin in 2026!. The $name syntax inserts a variable into a string. This is called a string template, and you will use it constantly.
Why learn Kotlin?
- Official language for Android, and Google’s recommended choice for new Android apps.
- Concise: the same logic usually needs noticeably fewer lines than Java.
- Null safety built into the type system, which prevents many crashes.
- Works with Java: you can call Java libraries and mix both languages in one project.
- Used beyond Android too: server-side (Ktor, Spring), desktop and multiplatform apps.
Common first-day mistakes
- Writing
Maininstead ofmain. Kotlin is case-sensitive. - Forgetting the quotes around text:
println(Hello)looks for a variable named Hello. - Mismatched braces. IntelliJ highlights the matching brace when you click next to one.
Practice exercise
Write a program that prints your name on the first line and your favourite programming language on the second.
fun main() {
println("My name is Omar")
println("I am learning Kotlin")
}Frequently Asked Questions
Do I need to know Java before learning Kotlin?
No. Kotlin is a good first language. Java knowledge helps you understand some background concepts, but this course starts from zero.
Is Kotlin free?
Yes. Kotlin is open source under the Apache 2.0 licence, and IntelliJ IDEA Community Edition and Android Studio are free.
Continue the course
Next: Lesson 2: Syntax & Output →
- Lesson 1: Getting Started (you are here)
- Lesson 2: Syntax & Output
- Lesson 3: Comments & Variables
- Lesson 4: Data Types
- Lesson 5: Operators
- Lesson 6: Set Operations & Grouping
- Lesson 7: Booleans & If…Else
- Lesson 8: When, While, Break & Continue
- Lesson 9: Arrays
- Lesson 10: For Loops & Ranges
- Lesson 11: Functions & Classes
- Lesson 12: Classes, Objects & Constructors
- Lesson 13: Class Functions & Inheritance
Conclusion
Kotlin is a powerful and expressive programming language that is easy to learn and use. It is a great language for Android development and is also used in other areas such as server-side development, web development, and data science.
Download From Link
You can download the lesson from the following link:













