File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Multithreading

Gopal Durairaj
Greenhorn

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: 1845
Hi,
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.
Regds.
Rahul P. Mahindrakar
Rajendra Deshpande
Ranch Hand

Joined: Nov 24, 2000
Posts: 40
Rahul,
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,
-Rajendra.
sujit singh
Greenhorn

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.
****sujit****
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multithreading
 
Similar Threads
On destroying fascism
How was I born?
getting thread names
Demon Thread
Demon Thread