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 are implicit objects in java?
How can be define MARKER interfce in java
what is meant by Garbage collection?
What is a finally block? Is there a case when finally will not execute?
What is the benefit of lambda expressions?
Which java version is latest?
What happens if we override only equals?
what is the purpose of the runtime class?
How do weakhashmap works?
Why are data types important?
What is clipping and repainting and what is the relation between them?
Is null an object in java?