Search This Blog

Friday, January 28, 2011

Question 6

Given that a static method doIt() in the Work class represents work to be done, which of the following blocks of code will succeed in starting a new thread that will do the work?

Picture

Answer : A

This is s a straight forward question. Option B is wrong because we should not override start method of a thread. Option C is incorrect because start() method must not be called on a runnable interface. Option D is incorrect because Thread constructor should take  runnable interface as an argument.But we are not provided with the information that whether work class implemented runnable interface or not.

Question 6SocialTwist Tell-a-Friend

No comments:

Post a Comment