Figure out how the program works. Similar to CountdownRunnable, create a CountUpRunnable thread that displays values in the counting order: from 1 to number.
Following a pattern
You must be signed in to leave a comment
7 October 2019, 14:50
It took me longer than I expected it would, but working with this kind of logic is very satisfactory.
8 February 2019, 16:50
Hint: if you copy and paste CountdownRunnable and tweak it to meet the requirements, CountUpRunnable doesn't run long enough before exiting. You need to change the order of something.
29 May 2019, 10:43
Thanks, man! I thought my problem was the reverse - that the thread ran for too long :) But after reading your hint I was able to put my code in the correct order so that the solution got accepted in full.
29 May 2019, 18:11
13 June 2019, 19:34
Yeah, look at your code and count how often "sleep" executes.
6 February 2021, 21:52
12 September 2021, 18:00
Yeah, this task tricks you by letting you assume that the countdown and countup methods are symmetrical. They are not. The countdown one only sleeps 4 times, and lasts only 2.0 seconds. The countup needs to sleep 5 times and last 2.5 seconds.