This repository is a collection of small problems to illustrate all the cool shit that you can do with Kotlin
- IntelliJ with the Kotlin plugin installed
- A configured JVM. It can be installed using
brew
:
brew cask install java11
Each folder in the source contains an exercise, with a README file describing what to do.
Tests can be run from IntelliJ or in the console by using:
./go test
Switch to the solutions
branch if you want to see the solutions for the exercises as well.
The exercises in bold don't have a concrete exercise to implement, they are more of a showcase with some code that can be played with.
Some exercises use concepts explained in other tapas. The dependsOn will help you visualize that. Other than that, there is no intended order. Follow your curiosity!
- dataclasses: Get to know data classes, the alternative to Lombok
- properties: Represent custom fields in your classes using properties
- dependsOn: dataclasses
- destructuring: Destructuring, a way of accessing multiple attributes at the same time
- inheritance: How does inheritance look like in Kotlin?
- delegation: Forwarding done easy
- dependsOn: properties
- sealed classes: Closed hierarchies
- Higher-order functions: Functions that receive or return functions
- dependsOn: extensions
- ranges: How to manipulate ranges
- dependsOn: operators
- Lambdas: Expressing your code in terms of lambdas
- Grouping: Grouping collections
- scopes: Less verbosity with scopes
- extensions: Extend objects with extension functions
- null safety: Handle
null
with care- dependsOn: scopes, extensions
- operators: Operator overloading
- exceptions: Exceptions in Kotlin