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.
Interruptions
Printing numbers with interruption
Report a typo
Write a program in Kotlin
import java.lang.Thread.sleep
// write your class here
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.