Search:     Advanced search
Browse by category:
C/C++   |   Java   |   Oracle/Database   |   SAP   |   ASP .NET   |   Mainframe-DB2   |   Freshers

What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class?

Add comment
Views: 286
Votes: 0
Comments: 0

Strategically speaking, threads created by implementing Runnable interface are more advisable. If you create a thread by extending a thread class, you cannot extend any other class. If you create a thread by implementing Runnable interface, you save a space for your class to extend another class now or in future.

Others in this Category
document What is the advantage of persistent message delivery compared to nonpersistent delivery?
document What is the use of ObjectMessage?
document What's the difference between a primary key and a unique key?
document What is an EJB Context?
document How EJB Invocation happens?
document I am trying to store an object using a key in a Hashtable. And some other object already exists in that location, then what will happen? The existing object will be overwritten? Or the new object will be stored elsewhere?
document What is NullPointerException and how to handle it?
document Q: How to synchronize ArrayList?
document State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
document What is Collection API?
» More articles



RSS