Hello the answer given to the code below says that Bang will execute for a second or two and It's difficult to predict which thread will be the last to finish. My question is how did they come to such conclusions from the code below? I had thought that it will execute for around 2 and half seconds ..
I just need explanations on why it is difficult to predict which thread and also the time factor in threads. Thanks
Well...it could be because java does not explicitly enforce thread scheduling in any specific manner and lacks a thread scheduler. Thread scheduling in Java is platform dependent and relies on your JVM implementation.