A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
  • Newsletters

concurrent programming

A collection of 1 posts
Even and odd with coroutines
Kotlin

Even and odd with coroutines

Recently, I stumbled upon one of Baeldung’s post showing how to use threads to print odd and even numbers: one thread dedicated to print odd numbers, another one to print even ones. Since I became aware of them, I was very interested in Kotlin coroutines and how they make concurrent programming code easier to read and write. I wanted to check how using coroutines would yield better code. Show me the code This is what I came up with: import java.util.concurrent.

Dec 16, 2018
A Java geek © 2008-2026
v. 1e36702bdd5aadacde73bd395fb1b580e1d1f65d/13988790172
Latest Posts