| Author |
Thread question
|
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
Guys, the question below is from here Question: All public methods in the Thread class are static and therefore only affect the current thread. True Or False? 1. True 2. False Answer: 1 How can it be true??? what about join() and setPriority???they are not static??
|
SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
|
 |
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
|
|
Just check the Thread API. If just one public method is not static, then the answer must be false. What about run() for example? Could be the author meant to restrict the question to only the Static members: All public static methods in the Thread only affect the current thread Regarding join() and setPriority(), look at the API to determine if they are static or not.
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
Joe Harry
Ranch Hand
Joined: Sep 26, 2006
Posts: 8795
|
|
|
The join() and setPriority() methods are not static. They are just final methods.
|
 |
 |
|
|
subject: Thread question
|
|
|