File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread question

 
Joe Harry
Ranch Hand
Posts: 10047
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Harry
Ranch Hand
Posts: 10047
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The join() and setPriority() methods are not static. They are just final methods.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic