A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
RabbitMQ in Depth
this week in the
Programmer Certification (SCJP/OCPJP)
Joined: Jun 21, 2005
Aug 03, 2005 03:47:00
In any class can we extend and implement the Thread Class and Runnable Interface simultaneously.
Joined: Jul 13, 2004
Aug 03, 2005 04:10:00
Yes u can!!
Reghu Ram Thanumalayan
Joined: Oct 21, 2003
Aug 03, 2005 05:07:00
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 %
Joined: Sep 28, 2004
Aug 03, 2005 06:21:00
But why you need to extend & implement it simultaneously. The thread class has already implemented the runnable interface.
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
I agree. Here's the link:
subject: Thread related
Is thread an Abstract Class and Why?
Is Struts Action class Thread Safe?
question about action class
Thread Q from Sierra & Bates SCJP Study Guide
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015