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 |
Explain the scope or life time of class variables or static variables?
What is the difference between the synchronized() & static synchronized()?
What is the difference between normal report & matrix report?
How do you do absolute value in java?
What is the length of a string?
Matrix multiplication only using OOP concepts .
What is the use of java?
when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?
Why do we need autoboxing in java?
What is the difference between @before and @beforeclass annotation?
By what default value is an object reference declared as an instance variable?
What are the latest versions in JAVA related areas?