while creating thread why we extend thread class

Answers were Sorted based on User's Feedback



while creating thread why we extend thread class..

Answer / jayaprasad

calling the Thread class methods like start().

Threads can be created in two ways
1) extends Thread class
2) implementing Runnable interface.

Is This Answer Correct ?    10 Yes 0 No

while creating thread why we extend thread class..

Answer / pamal janveja

To create User Defined thread, We requires features of thread
and java provide us Thread class.
We simply over right its run method and called this by start method which internally call to run method.
Similarly using other methods of Thread class , we can create,access and delete user defined thread.

Note:- Without Thread class or Runnable interface , We can not create User defined Thread.

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is difference between static class and singleton pattern?

0 Answers  


What are different exception types exceptions available in java ?

0 Answers  


What is protected access modifier?

0 Answers  


What are different ways of object creation in java ?

0 Answers  


How many techniques can be employed to create a string object?

0 Answers  






What is the base class of all exception classes in java?

0 Answers  


How do you delete a list in java?

0 Answers  


how to run ecllipse with jettyserver for windows environment using batch file

0 Answers  


do I need to use synchronized on setvalue(int)? : Java thread

0 Answers  


what is main purpose of interface?

2 Answers   Accenture, HCL, NIIT,


What is the difference between length and length () in java?

0 Answers  


What are the special characters?

0 Answers  


Categories