Why I getting an error? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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