This repo is built as a practical learning resource for Kotlin beginners and early intermediate learners. It focuses on core Kotlin features and on using code examples that are easy to run and easy to reason about.
Many beginner repos are just a few random scripts. This repo is meant to teach the language as a whole:
- syntax and structure
- functions and data flow
- collections and abstractions
- safety and validation
- objects and reuse
- async patterns
- testing fundamentals
- Variables and types
- Control flow
- Functions and defaults
- Collections and null safety
- Classes and data classes
- Interfaces and inheritance
- Generics and lambdas
- Exceptions and validation
- Coroutines basics
- Testing patterns
- Final project: study tracker
Compile and run a single lesson file at a time:
kotlinc lessons/01_variables_and_types.kt -include-runtime -d lesson.jar
java -jar lesson.jarUse the same pattern for any lesson file. Do not compile every file at once unless each file is meant to be independent and you understand the result.
lessons/— individual, runnable Kotlin lessonsREADME.md— overview and learning pathlessons/12_kotlin_cheat_sheet.md— compact reference notes
- Read the comments.
- Run the example exactly as written.
- Change one value and predict the output.
- Add your own mini challenge.
- Repeat with different inputs.
The last lesson is a small study tracker app that can do the following:
- add study topics
- mark them complete
- list incomplete work
- calculate the progress percent
- reject bad input like an empty topic name
This gives you a realistic project that combines most of the major Kotlin ideas in one place.
- Kotlin docs: https://kotlinlang.org/docs/home.html
- Kotlin basics: https://kotlinlang.org/docs/basic-syntax.html
- Null safety: https://kotlinlang.org/docs/null-safety.html
- Coroutines: https://kotlinlang.org/docs/coroutines-guide.html
- Collections: https://kotlinlang.org/docs/collections-overview.html
This is a strong beginner-to-intermediate learning repo. It gives you a solid Kotlin foundation and demonstrates the kind of code patterns used in real projects, without pretending to be a complete description of every Kotlin edge case.