This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello, i am not sure about one answer in the book of Kathy Sierra and Bert Bates.
On Page 534 you find a table that says which methods belong to which class:
Class Object wait() notify() notifyAll()
Class Thread start() yield() sleep() join()
Interface Runnable run()
The Question is Question: Which two of the following methods are defined in class Thread? A. start() B. wait() C. notify() D. run() E. terminate()
Depending on the table i would say only A is correct, but the correct answer:
Correct: A and D. Only start() and run() are defined by the Thread class. Uncorrect: B and C are incorrect because they are methods of the Object class. E is incorrect because there�s no such method in any thread-related class.
So my question is: Why is D correct ? I think it belongs to Thread. Or is the answer so simple that tread implements runnable ??