Welcome to Kotlin By Example


Learn Kotlin with small simple annotated examples. Click on the left navigation menu to go to a specific sample. Make sure you check back often, as the website gets updated frequently.


Source code on GitHub

  1. Create a new markdown file
  2. Give it a title.
  3. Create the sample.
  4. Add the entry to the examples file
  5. Send a Pull Request!


  • Try and keep text to a minimum. Remember, this site is not trying to replace documentation nor necessarily describe all edge cases or dive into details. Rule of thumb should be a single paragraph introducing the example. Rest should be line annotations.
  • Use 4 spaces for tabs.
  • Make sure examples compile and also have some output when they run.


Copyright MIT (c) 2017-2018 JetBrains