The following is part of the code for an application that will run two time consuming processes in two Threads. We want to be sure that all threads get a chance to run. Which statement at line 9 will accomplish this?
Here answer is A,D THe answer is not C.The reason given is because the class does not extend thread . Does that mean that if a class does not extend thread and implements runnable we cannot use yield() directly.I thought its because its static.. What is the concept here??
Cheers Smitha [ August 24, 2005: Message edited by: Barry Gaunt ]
hi when u use yield(); the call to the method is implicitly like this.yeild(); and runnable interface has no methods like yeild() and ur class didn't provide any method by name yeild() so u get a compiler error says the method yeild is undefined for Testxx class