aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Use of implementing Runnable Interface 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 "Use of implementing Runnable Interface" Watch "Use of implementing Runnable Interface" New topic
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
Sheriff

Joined: Aug 03, 2008
Posts: 9313
    
  17

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of implementing Runnable Interface