while creating thread why we extend thread class
Answers were Sorted based on User's Feedback
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 |
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 |
What is string data type?
Explain different ways of creating a thread. Which one would you prefer and why?
What are event-delegation model and event-inheritance model? Which is best?
What are the application of stack?
Difference between abtsract & final
What is Enum in Java?
What is the use of parseint in java?
What is the string function?
What is method with example?
How do you add an element to a hashset in java?
Which class contains a method: cloneable or object?
I/O blocking means?