| Author |
Use of implementing Runnable Interface
|
aresh babu
Ranch Hand
Joined: Aug 31, 2008
Posts: 65
|
|
Hi,
can any one please let me know the use of implementing Runnable interace than extending a Thread class except achieveing the multiple inheritance??
Thanks
AreshBabu
|
 |
Rajeev Rnair
Ranch Hand
Joined: Mar 22, 2010
Posts: 308
|
|
I think if you extend 'Thread', you cannot extend any other class.
But if you implement 'Runnable' you still can extend some class and implements other interfaces if you want to.
Other than that I don't know any differences.
note that "Thread" class also implements "Runnable" interface
that is why we can call
|
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
Generally implementing Runnable is more common than extending Thread class. Extending the Thread class doesn't give you much that you can use...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
|
|
subject: Use of implementing Runnable Interface
|
|
|