• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multithreading

 
Gopal Durairaj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1868
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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****
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic