undefined

Tasks about interrupt

Java Core
Level 6 , Lesson 10
Available

"Hello, Amigo!"

undefined
9
Task
Java Core, level 6, lesson 10
Locked
Counting seconds
1. Write an implementation for the run method in the Stopwatch thread. 2. The Stopwatch class must count the number of seconds that have passed from the creation of the thread until a string is entered. 3. Display the number of seconds.
undefined
18
Task
Java Core, level 6, lesson 10
Locked
Countdown at the races
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
undefined
4
Task
Java Core, level 6, lesson 10
Locked
Another interruption
Create a TestThread. In the main method, create a thread, run it, and then interrupt it using the interrupt() method.
undefined
9
Task
Java Core, level 6, lesson 10
Locked
No interrupt, no dice?
Figure out how the program works. Make it so that the ourInterrupt method allows the TestThread to terminate itself. Don't use the interrupt method.
undefined
9
Task
Java Core, level 6, lesson 10
Locked
One for all, all for one
1. Figure out how the program works. 1.1. Note that the Water object is the same for all the threads. 2. Implement the ourInterrupt() method so that it interrupts all threads in the threads list. 3. Correct the values ​​of the variables in the run() method: 3.1. isCurrentThreadInterrupted must be the s
Comments (27)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Shilpa nori Level 33 Rochester United States
31 January 2021
My nightmare: "Figure out what the code does". lol
Oliver Heintz Level 18 Mustang United States
31 January 2021
I think I much prefer to write my own code, rather than modifying existing code. Especially when I am presented something with no context and told to "figure out what this does". Like... how about telling me what it's SUPPOSED to do.
Attila Level 25
7 April 2020
#5 Use the official version.
Nyerges Ferenc Level 23 Bükkábrány Hungary
10 February 2020
Awesome tasks, this topic was a grey area to me till now
Robert Constantinescu Level 25 Bucharest Romania
22 November 2019
Great job being one of the few to arrive here ! Good luck further ! I was lvl 19 when i wrote this. What level am i know?
msantagiulianab Level 26 London United Kingdom
6 October 2019
Can anyone please recommend a good source to study multithreading in java? (website or book)
Juanf Level 25 Vilnius Lithuania
24 September 2019
Well..., I'd say that in "No interrupt, no dice?" they should clarify more in requirements how much or how less and where it is possible to change the code..., otherwise you can break your head looking for a walkaround while it's easier...
Almaz Temirkanov Level 24 Bishkek Kyrgyzstan
11 September 2019
#4 use isCancel
Almaz Temirkanov Level 24 Bishkek Kyrgyzstan
11 September 2019
#2 Attention -> volatile int
Ewerton Level 30 Belo Horizonte Brasil
2 July 2019
Repetitive exercises are exhausting, but the method really works.