Countdown at the races

  • 18
1. Figure out what the program does. 2. Implement the run method so that each second the count is displayed, separated by spaces and starting from numSeconds down to 1, and then "Go!" (see the examples). 3. If the thread runs for 3.5 seconds or more, interrupt it using the interrupt method and wit
You can't complete this task, because you're not signed in.
Comments (5)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
LennyMan Level 25, Lucca, Italy
30 December 2020, 15:58
I resolved correctly the task, but im not sure to understand why if we put Thread.sleep fo 3.5 seconds, the method throw the InterruptedException
LennyMan Level 25, Lucca, Italy
30 December 2020, 16:00
Ok maybe i understood , the method throw the exception when in the main reach the line clock.interrupt(); (after 3.5seconds) , is it correct?
Liliane Top Level 17, Amsterdam, Netherlands
5 April 2020, 12:23
Good advice. Do not look at the examples as given in the previous lesson. They will just confuse you. Find a source outside of CodeGym if you want to understand how this works as the information given in lesson 8 and 9 are not working. Try for yourself!
Nikolaos Level 19, Vrontados, Greece
8 October 2019, 17:59
It takes me about 2 hours... -_-
Robin Singh Chauhan Level 17, Periyakulam, India
22 August 2019, 19:57
The only problem is i am able to display the exact output but not able to do it together this means at numSeconds=3; the output for numSeconds=3 is correct but wrong for numSeconds=4 and vice versa