aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes thread statement is too vague for me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "thread statement is too vague for me" Watch "thread statement is too vague for me" New topic
Author

thread statement is too vague for me

Ivy Kho
Greenhorn

Joined: Oct 20, 2004
Posts: 17
I've been study threads for the scjp using the book by Heller and Roberts, 4th edition and I came across this statement which seems vague (for me). could somebody help me by elaborating or better, by giving an example?

"Putting run() in a subclass of Thread may mean that the method cannot access features it needs (or cannot access those features in a clean, reasonable manner)"
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

I'm not sure what that means either. Perhaps the surrounding text gives it more meaning, but the sentence by itself hints at something not immediately apparent to me.

The obvious disadvantage to extending the Thread class is that you cannot extend another class. It doesn't save you much effort, either.

Implementing the Runnable interface is a better solution; I don't think there's much discussion on that point any more. Some people contend that the options are equivalent because they're both 'legal'. That argument to me is a dull and needlessly defensive argument at best.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: thread statement is too vague for me
 
Similar Threads
Sybex: Context attribute thread safety
Transactions - JTA or JDBC?
Behavior of scheduler
thread strategies
is it true