Kotlin Tutorial
Kotlin is a modern programming language made by JetBrains. Google chose it as the main language for Android apps, so most new Android apps today are written in Kotlin.
Kotlin is short, safe and easy to read. It also runs anywhere Java runs, so you can use it for servers and desktop programs too.
Why Learn Kotlin?
- It is the first choice for building Android apps
- Its code is shorter and cleaner than Java code
- Its null safety stops many common crashes before your app even runs
- Android developers are in demand in Pakistan and on freelancing sites
What You Will Learn
- How a Kotlin program is written and run
- Variables, data types and null safety
- Operators, strings, conditions and loops
- Lists, sets and maps
- Functions and lambdas
- Classes, objects, inheritance and data classes
A First Example
Example
fun main() {
val name = "Ali"
println("Assalam o Alaikum, $name!")
}Assalam o Alaikum, Ali!
You can run every example in this tutorial in the free online Kotlin Playground or in IntelliJ IDEA. Change the values and run them again to see what happens.
Exercises and Quiz
Each lesson ends with a short exercise. The last lesson is a quiz on the whole tutorial.
Exercise
Which company created Kotlin?
What to Learn After Kotlin
After Kotlin, learn Android app development with Jetpack Compose. You may also like Swift for iPhone apps, or Java, the language Kotlin grew from.
Want to build real Android apps with a teacher? The Workownix App Development course covers Kotlin and Android step by step, online or at our institute in Orangi Town, Karachi.
