CodeGym /Courses /Java Core /Tasks about join

Tasks about join

Java Core
Level 6 , Lesson 5
Available

"Hello, Amigo!"

4
Task
Java Core, level 6, lesson 5
Locked
join: at the right time in the right place
The join method is very useful and is often used to terminate a thread. Think about where and on what object you need to call this method to have the result displayed
18
Task
Java Core, level 6, lesson 5
Locked
Horse racing
Programming is better than gambling... Still, horse races and other races perfectly illustrate multithreading! Figure out what the code does, and implement a method that counts the number of horses that have crossed the finish line. One more thing: you need to wait for the longshots to finish the race.
9
Task
Java Core, level 6, lesson 5
Locked
Promotion during political debates
Mr Chump is our candidate! And we'll help him a bit by making him give a speech, and then another, and then another during a political debate. We'll help him a little by making him talk until all the available time has been taken. Threads come to our rescue!
4
Task
Java Core, level 6, lesson 5
Locked
Justice
Justice is the name of an ancient Terrian deity that no one ever saw in the flesh. That said, Justice is sometimes encountered in man-made systems. We've got some mice here. For some reason, one of the mice, the alpha male, eats first while the others wait. Figure out why and remove this method call.
9
Task
Java Core, level 6, lesson 5
Locked
Arranging calls to join()
First, the cat gives birth to kittens. Then all the kittens climb out of the basket in random order. Finally, the cat brings them back into the basket. These events for one cat may be interspersed with events for another cat. Now implement this scenario with join().
Comments (23)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
Evgeniia Shabaeva Level 38, Budapest, Hungary
29 July 2024
The tasks are easy to complete, but the topic is hard to understand. I hope the tasks coming after this will help me (all of us) sort out how to properly use threads ourselves.
P.B.Kalyan Krishna Level 24, Guntur, India
7 June 2022
One thing I have noticed is the easy part is left for us to accomplish, where as complex logic is done by CodeGym in the programs given to us as exercises. This doesn't help us much, I think. We should be able to write the entire program, and then only we will be confident. It would have been nice if there are programming exercises given to us as home work. I think CodeGym should look into this aspect in the future.
Chandan Thapa Level 22, Dubai, United Arab Emirates
10 December 2020
Splendid!!
Collin Morudi Level 17, Polokwane, South Africa
12 September 2020
The tasks are easy so far, but I can't say i understand very well. It's a bit harder for me.
Agent Smith Level 38
30 August 2020
Tasks are easy so far. I wonder what surprises they have for us at the end of this level. :D
Manish Sinha Level 26, london, United Kingdom
15 April 2020
thanks Codegym for this lovely tasks. Enjoyed a lot..waiting and excited for bonus excercises.
MaGaby2280 Level 41, Guatemala City, Guatemala
21 January 2020
After this... I am getting a kitten ;o)
Vahan Level 41, Tbilisi, Georgia
25 September 2019
Champ doesn't allow other candidates to conduct the campaign, he must be eliminated from the race.
KIN SOCHEAT Level 34, Phnom Penh, Cambogia
9 September 2019
I pass with this code but I think this code something wrong. Caz one time click pass second time click not pass. while (chump.getSpeechCount() + dustbin.getSpeechCount() + schooner.getSpeechCount() < totalSpeechCount) { } chump.join(); //dustbin.join(); // schooner.join(); System.out.println(chump); System.out.println(dustbin); System.out.println(schooner);
holybible Level 28, Plovdiv, Bulgaria
31 August 2019
lol took me 28 attempts on the last one :D
Devonte A Level 18, Rubery, United Kingdom
15 July 2020
But you did it and thats the main thing!