This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread related Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread related" Watch "Thread related" New topic
Author

Thread related

Shishir malviya
Greenhorn

Joined: Jun 21, 2005
Posts: 25
In any class can we extend and implement the Thread Class and Runnable Interface simultaneously.
Priya Jothi
Ranch Hand

Joined: Jul 13, 2004
Posts: 168
Yes u can!!
Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
The general rule of thumb is " Implement Runnable if you need to run any task in a separate thread and Extend Thread if you need to inherit the thread properties for the class in addition to running the task in itself "


Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
But why you need to extend & implement it simultaneously. The thread class has already implemented the runnable interface.

Srini


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread related
 
Similar Threads
Thread Q from Sierra & Bates SCJP Study Guide
question about action class
Is Struts Action class Thread Safe?
Thread names??
Is thread an Abstract Class and Why?