Printing numbers with interruption

Report a typo

Write a class PrintNumbers that extends Runnable and prints the numbers from 0 to 9 every second, every number on a new line. The instance of this class will be interrupted outside, so you need to catch an exception if it is thrown and then do break.

Write a program in Kotlin
import java.lang.Thread.sleep

// write your class here
___

Create a free account to access the full topic