Why I getting an error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Why I getting an error?

I don't know why the test case fail, pls help https://code.sololearn.com/cZop5eeRXte7/?ref=app

14th Apr 2023, 6:46 PM
Sakshi
Sakshi - avatar
6 Answers
+ 6
Ani Jona 🕊 yes you are right my mistake is I write this:- name.start(); welcome.start(); instead of this:- welcome.start(); name.start(); Thank you both of you Jayakrishna 🇮🇳 Ani Jona 🕊
14th Apr 2023, 7:52 PM
Sakshi
Sakshi - avatar
+ 5
Thread priorities are but a suggestion. Also, the thread runtime is very short so priorities may not take effect. But still output needs to be in proper order to be accepted. Try reversing the order in which you start the threads and see if that changes anything. If it doesn't succeed in the first try, hit run again. At some point the order of output will be correct.
14th Apr 2023, 6:54 PM
Ani Jona 🕊
Ani Jona 🕊 - avatar
14th Apr 2023, 7:40 PM
Jayakrishna 🇮🇳
+ 5
It's not a mistake. Task is too do like that only. Just it won't work as expected because of code which just need too less time. Reverse is also a hack to pass test. ( if it is thread priority task which i know).. You're welcome..
14th Apr 2023, 8:02 PM
Jayakrishna 🇮🇳
+ 5
Jayakrishna 🇮🇳 Yaa! I need to reverse the order because it depends on the thread priority 😅
14th Apr 2023, 8:13 PM
Sakshi
Sakshi - avatar
+ 2
You're welcome :)
15th Apr 2023, 4:20 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar