Re: need to know appropriate ans
Posted By:
Robert_Lybarger
Posted On:
Thursday, September 13, 2007 09:37 AM
Option 1 will cause the 'run()' block to execute in the current thread, not a new thread. Option 2 just calls some static method in the instance, but that method does nothing as far as thread operations are concerned. Option 3 creates a new new thread instance, but the constructor on its own doesn't start the thread up. Option 4 creates a new thread with your class' code, then starts it (the right answer). Option 5 tries to call a method variation in Thread that doesn't exist: the start method takes no arguments (compile error).