CodeGym /Courses /Java Core /Bonus task | Lesson 13 | Level 6

Bonus task | Lesson 13 | Level 6

Java Core
Level 6 , Lesson 13
Available

"Hey, soldier!"

"Good day, Captain!"

"I've got awesome news for you. Here are some exercises to reinforce your skills. Do them every day and your skills will grow at an insane speed. They were created especially for IntelliJ IDEA."

4
Task
Java Core, level 6, lesson 13
Locked
Thread.currentThread always returns the current thread
Thread.currentThread always returns the current thread
4
Task
Java Core, level 6, lesson 13
Locked
Consecutive threads
Consecutive threads
18
Task
Java Core, level 6, lesson 13
Locked
Creating threads recursively
Creating threads recursively
4
Task
Java Core, level 6, lesson 13
Locked
Consecutive threads
Consecutive threads
4
Task
Java Core, level 6, lesson 13
Locked
Deadlock
Deadlock
9
Task
Java Core, level 6, lesson 13
Locked
Following a pattern
Following a pattern
18
Task
Java Core, level 6, lesson 13
Locked
Shall we play?
Shall we play?
18
Task
Java Core, level 6, lesson 13
Locked
The early bird gets the worm
The early bird gets the worm
9
Task
Java Core, level 6, lesson 13
Locked
Take your turn!
Take your turn!
18
Task
Java Core, level 6, lesson 13
Locked
Sequential file output
Sequential file output

"Those previous exercises were for rookies. I've added some more advanced bonus exercises for the old-timers. Just for veterans."

18
Task
Java Core, level 6, lesson 13
Locked
Factory method pattern
Factory method pattern
18
Task
Java Core, level 6, lesson 13
Locked
Clew
Clew
18
Task
Java Core, level 6, lesson 13
Locked
Debug everything under the sun
Debug everything under the sun
Comments (34)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Vazhiko Level 24
21 June 2025
I've to say: it was a bit of a challenge
Hoist Level 12, San Diego, United States
17 September 2024
Output: Thread 1: My exception message Thread 2: My exception message
Daniel Ketcheson Level 28, Canada
4 September 2023
Multi-threading is like getting bit by a radioactive spider. Things will be weird for a while, hard to adapt to. Ultimately, it's when you got your superpowers.
vhunjek Level 33, Varazdin, Croatia
16 February 2022
In Clew task, hint will just throw you out of track (Thread 4 can be checked using isAlive()).
vhunjek Level 33, Varazdin, Croatia
14 February 2022
In Creating threads recursively, why Thread.currentThread().getName() isn't validated in toString method?
vhunjek Level 33, Varazdin, Croatia
14 February 2022
In first Consecutive threads task first comment "//write your code here" is placed inappropriately.
DarthGizka Level 24, Wittenberg, Germany
5 June 2021
task1631 (Factory method pattern) pitfall: the task turned up another dark corner of the language, which is that switch statements explode if presented with a null value. This is somewhat suprising since there is no dereferencing of any pointers involved, only comparison of pointer values. A chained if statement with operator == would not exhibit such weird behaviour. Anyway, this is relevant to the task at hand because there is a specific requirement which exception should be thrown for any illegal arguments.
Anonymous #10843013 Level 24, Germany, Germany
17 May 2022
Thank you for bringing this up! I spend the last 10minutes searching for my mistake in the switch-case
DarthGizka Level 24, Wittenberg, Germany
5 June 2021
task1630 (Sequential file output) undocumented requirement: your code will be failed unless it reacts to invalid inputs by printing an empty string instead of null or whatever (i.e. the content of a non-existing file is deemed to be "").
DarthGizka Level 24, Wittenberg, Germany
5 June 2021
task1626 (Following a pattern) caveat: you will get failed if you 'follow the pattern' (i.e. if you emulate the broken logic of the CountdownRunnable code as you are told) because it runs afoul of the requirement "The CountUpRunnable class's run method should run for approximately 2.5 seconds". I bet on the wrong horse and lost - don't follow my pattern. 😉
ayhem bouabid Level 25, Tunis, Tunisia
30 May 2021
That moment when one completes all the easy and medium tasks and has to face the hard tasks...