Kotlin Tutorials

Kotlin tutorials for beginners: functions, classes and objects, interfaces, collections and small programs you can run in Android Studio.

Showing 10 of 42 Results

Free course · Beginner friendly

Learn Kotlin step by step

From your first program to coroutines. Each lesson builds on the one before, so follow them in order.

  • 51 lessons
  • 11 modules
  • ~3 hrs of reading
  • Free, no sign-up
Your progress0%
0 of 43 lessons done
Start lesson 1What is Kotlin?

Saved in this browser automatically

  1. Read one lessonAbout 5 minutes each
  2. Run the codePaste examples into Kotlin Playground
  3. Do the exerciseThen move to the next lesson
Module 1Getting started0/4 lessons
  1. 1What is Kotlin?What is Kotlin? A clear explanation of the Kotlin programming language: who made it, key features…5 min
  2. 2Set up Kotlin (Playground, IntelliJ IDEA, Android Studio)Start writing Kotlin today: the online Kotlin Playground, IntelliJ IDEA, Android Studio or the kotlinc compiler.…4 min
  3. 3Your first Kotlin programWelcome to the second part of the Kotlin tutorial, In this chapter, we will write our…3 min
  4. 4Basic syntaxHey Developers, welcome back to part 3 of Kotlin tutorials. In this post, we will quickly…5 min
Module 2Basics0/5 lessons
  1. 5Variables: val, var and constKotlin has two keywords for variables: val for a value that can’t be reassigned and var…3 min
  2. 6Data typesKotlin data types with examples: Int, Long, Byte, Short, Double, Float, Char, Boolean and String, their…4 min
  3. 7Type conversionConvert types in Kotlin: Int to Double, String to Int with toInt and toIntOrNull, numbers to…3 min
  4. 8Strings and string templatesKotlin strings with examples: string templates, length, substring, split, replace, trim, comparing strings, multiline raw strings…4 min
  5. 9Input and outputPrint output and read user input in Kotlin with print, println and readln. Read numbers safely,…3 min
Module 3Operators0/3 lessons
  1. 10Arithmetic operatorsWelcome back to Kotlin Operators tutorials, In this post, we will discuss about Arithmetic Operators (Mathematical…3 min
  2. 11Comparison operatorsRelation comparison operators are making a comparison between two variables. Hence, the comparison operator helps us…4 min
  3. 12Logical, assignment and increment operatorsKotlin logical operators (&&, ||, !), assignment operators (+=, -=, *=), increment and decrement (++, --)…4 min
Module 4Control flow0/5 lessons
  1. 13if-else expressionLearn Kotlin if, if-else and else-if with examples. Use if as an expression to return a…3 min
  2. 14when expressionKotlin when expression explained: match values, several values per branch, ranges with in, type checks with…4 min
  3. 15Practice: calculator using whenKotlin, a versatile and concise programming language, allows developers to achieve just that. In this post,…2 min
  4. 16for loop and rangesLearn the Kotlin for loop: ranges (1..10, until, ..3 min
  5. 17while, do-while, break and continueKotlin while and do-while loops, when to use them instead of for, how break and continue…3 min
Module 5Null safety0/1 lessons
  1. 18Null safety: ?, ?., ?:, !! and letKotlin null safety explained: nullable types, safe call ?., Elvis ?:, the !! operator, let, smart…4 min
Module 6Functions0/8 lessons
  1. 19Types of functionsKotlin offers several types of functions, each with its own unique characteristics and use cases. In…6 min
  2. 20Function return typesOne of the key aspects of Kotlin is its functions, which are essential for writing efficient…3 min
  3. 21Unit vs void vs NothingUnit functions are functions in Kotlin that do not return any value. They are represented by…3 min
  4. 22Default and named arguments, varargLearn Kotlin default arguments, named arguments and vararg with examples: skip optional parameters, call functions clearly,…4 min
  5. 23Lambdas and higher-order functionsKotlin lambdas and higher-order functions: lambda syntax, it, function types, passing and returning functions, trailing lambdas…4 min
  6. 24Extension functionsKotlin extension functions and properties: add functions to existing classes like String and Int, nullable receivers,…4 min
  7. 25Scope functions: let, run, with, apply, alsoKotlin scope functions explained with examples: let, run, with, apply and also. See what each returns,…5 min
  8. 26How functions are used in real appsFunctions are an essential part of any programming language, and Kotlin is no exception. They allow…2 min
Module 7Collections0/6 lessons
  1. 27ArraysLearn Kotlin arrays with examples: arrayOf, IntArray, Array(size), reading and changing elements, looping, sorting, searching, 2D…3 min
  2. 28List and MutableListLearn Kotlin List and MutableList: listOf, mutableListOf, reading items, add, remove, update, searching, sorting, sublists and…4 min
  3. 29SetKotlin Set and MutableSet: setOf, mutableSetOf, unique values, add and remove, union, intersect and subtract, and…3 min
  4. 30MapKotlin Map and MutableMap: mapOf with to, reading values safely, getOrDefault, adding and updating entries, looping,…4 min
  5. 31List to mapConvert a List to a Map in Kotlin with associateBy, associateWith, associate, toMap, groupBy and zip…4 min
  6. 32Collection operations: map, filter, reduceKotlin collection functions with examples: map, filter, forEach, any/all/none, find, sumOf, sortedBy, groupBy, partition, flatMap, zip,…5 min
Module 8Object-oriented programming0/11 lessons
  1. 33Class and objectKotlin class and object are used to model real-world entities in software applications. By creating class…4 min
  2. 34Constructors and initKotlin constructors explained: primary constructors with val and var, default values, init blocks, secondary constructors and…4 min
  3. 35Inheritance: open, override, superKotlin inheritance explained: why classes are final by default, open and override, calling super, overriding properties…4 min
  4. 36Visibility modifiersKotlin visibility modifiers explained: public, private, protected and internal for classes, members and top-level code, with…4 min
  5. 37Abstract classesKotlin abstract classes: abstract functions and properties, shared code and state, constructors, and when to use…4 min
  6. 38InterfacesIf you're looking to build robust and efficient applications in Kotlin, you've come to the right…3 min
  7. 39Data classesKotlin data classes: what they generate (equals, hashCode, toString, copy), destructuring, rules and limits, and data…4 min
  8. 40Enum classesKotlin enum classes explained: constants, properties and functions, entries, valueOf, name and ordinal, enums with when,…4 min
  9. 41Sealed classesKotlin sealed classes and sealed interfaces: restricted hierarchies, exhaustive when, modeling UI state and results, and…5 min
  10. 42object and companion objectKotlin object and companion object: singletons, object expressions, companion objects for factory functions and constants, and…4 min
  11. 43GenericsComing soon
Module 9Advanced Kotlin0/3 lessons
  1. 44Exception handlingComing soon
  2. 45Type checks and smart castsComing soon
  3. 46Delegation: by lazy and byComing soon
Module 10Coroutines0/3 lessons
  1. 47Coroutines basicsComing soon
  2. 48Dispatchers and scopesComing soon
  3. 49Kotlin FlowComing soon
Module 11Practice and next steps0/2 lessons
  1. 50JSON to Kotlin data classHow to convert JSON to Kotlin data classes: nested objects, lists, nullable fields, and annotations for…4 min
  2. 51Kotlin interview questionsComing soon
WhatsApp us📞 Call now