mardi 13 juin 2017

Java threads task

Need help with this task: Write a program which creates 5 named threads. After launching the program, every thread waits random time and prints its name. Every 5-th thread can print name in any time, 4-th prints after 5-th, 3-rd after 4-th and etc. In addition, thread should print its waiting time. Main thread tries to interrupt randomly chosen thread.In this case,chosen thread should be interrupted and print a message about its interruption. Threads interruption should not break the order of launching child-threads.




Aucun commentaire:

Enregistrer un commentaire