jQuery in Action, 3rd edition
The moose likes Threads and Synchronization and the fly likes Multithreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Multithreading" Watch "Multithreading" New topic


Gopal Durairaj

Joined: Jan 03, 2001
Posts: 3
Thread is an abstract class;i.e we cannot directly instansiate it.But we create thread instances using new keyword.
How is it possible?
pl explain.
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
Thread is not an abstract class. Please check the java api for the definition of the Thread class. Thus an object of Thread can be made by using the "new" keyword.
Rahul P. Mahindrakar
Rajendra Deshpande
Ranch Hand

Joined: Nov 24, 2000
Posts: 40
How does one decide which option to use to create a thread from the 2 given below..
1.Extending the THREAD class
2.Implmenting the 'RUNNABLE' interface.
Thanks and regards,
sujit singh

Joined: Dec 04, 2000
Posts: 18
Dear Rajendra ,
Its upto u to choose. If u have to make a class which must extend from another class eg an applet ,and also u have to use multithreading ,then u have no other option but use Runnable interface. In other cases u are free to choose ur option.
I agree. Here's the link: http://aspose.com/file-tools
subject: Multithreading
jQuery in Action, 3rd edition