This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

instance methods of Thread class

 
jesse harris
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was taking brogden's hardest questions simulation and had a question. It asks for the instance methods of the Thread class. It offers toString() as a correct option. toString is a method of class Object not thread. I understand Thread inherits from Object, but this question seems ambiguous. For general advice on answering exam questions would all methods of all superclasses of a class be considered methods of the class?
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question. I don't think you'll find trick questions like this one in the real exam. Although you should know of course, <CODE>inheritance</CODE>. Which dictates that a non-private method in a class is inherited by all subclasses in the same package (if the original access is package) or by all subclasses if the access is protected or public.
 
jesse jay
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would I be right in assuming that in general when someone refers to "the methods of class X" that they would be referrring to the methods implemented in X.java?
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you would. Otherwise it would be a "trick question" and there are no such questions in the Certification Exam.
Good Luck!
 
Shar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thread's toString() method overrides the Object's toString() method. That is why it is an instance method of a thread class. http://java.sun.com/products/jdk/1.2/docs/api/index.html link takes you there to read about toString method in Thread class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic