• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

instance methods of Thread class

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic