Module-Wise Kotlin Learning Guide
Module 1: Introduction to Kotlin
- What is Kotlin?
- Setting up Kotlin (IDE: IntelliJ IDEA or Android Studio)
- Kotlin vs Java (overview)
- Writing your first Kotlin program (Hello World)
- Exercises: Install IntelliJ IDEA, Write a simple program to print your name, Try running basic print
statements
Module 2: Basic Syntax & Variables
- Variables (val vs var)
- Data types (Int, String, Double, Boolean)
- String templates
- Comments
- Exercises: Take name & age, print: Hello, <name>. You are <age> years old.
Module 3: Control Flow
- if, else
- when (like switch in Java)
- Loops: for, while, do-while
- Ranges
- Exercises: Find if a number is even or odd, Use when to print day of the week for a number (1 to 7)
Module 4: Functions
- Declaring functions
- Default & named arguments
- Single-expression functions
- Unit return type
- Exercises: Function to add two numbers, Function with default arguments
Module 5: Collections
- Arrays
- Lists (mutable & immutable)
- Maps & Sets
- Looping through collections
- Exercises: List of fruits & print, Map of subject -> marks & find average
Module 6: Classes & Objects
- Classes & constructors
- Properties & methods
- init block
- data classes
- object keyword (singleton)
- Exercises: Student class with name & age, data class Book with title & author
Module 7: Inheritance & Interfaces
- Inheritance basics
- open keyword
- Abstract classes
- Interfaces
- Exercises: Base class Animal & derived classes Dog & Cat, Interface Playable with method play()
Module 8: Null Safety
- Nullable types ?
- Safe calls ?.
- Elvis operator ?:
- !! operator
- let function
- Exercises: Nullable string & print length safely, Elvis for default values
Module 9: Higher Order Functions & Lambdas
- Lambdas
- map, filter, forEach
- Inline functions
- with and apply
- Exercises: Use map & filter on list, Lambda to add two numbers
Module 10: Basic Android with Kotlin
- Setting up Android Studio
- Kotlin in Android Projects
- Activities & XML layouts
- Button click listener in Kotlin
- Using findViewById & ViewBinding
- Exercises: App with Button & TextView, On button click change text