wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes instance methods of Thread class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "instance methods of Thread class" Watch "instance methods of Thread class" New topic
Author

instance methods of Thread class

jesse harris
Ranch Hand

Joined: Oct 02, 2000
Posts: 62
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

Joined: Jan 30, 2000
Posts: 3222
    
    5
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.


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
jesse jay
Greenhorn

Joined: Sep 23, 2000
Posts: 11
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

Joined: Jan 30, 2000
Posts: 3222
    
    5
Yes you would. Otherwise it would be a "trick question" and there are no such questions in the Certification Exam.
Good Luck!
Shar
Greenhorn

Joined: Oct 10, 2000
Posts: 2
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.
 
Consider Paul's rocket mass heater.
 
subject: instance methods of Thread class
 
Similar Threads
Threads
synchronization issue
Thread locks
Thread locks
can thread access the non-synchronized method in a class when other thread hold lock