how many ways to create Thread and which one is good?
runnable interface ot Thread class?
Answers were Sorted based on User's Feedback
Answer / balaji@cse@crr engg@eluru
types of creating thread
1)extend thread class
2)implement by runnable interface
=>2"nd method is good because by using interface we can
implement multiple inheritance
| Is This Answer Correct ? | 16 Yes | 0 No |
Answer / guest
Two ways to create threads
1)by creating thread class
class classname extends Thread
{
}
2)By converting class to thread ie using Runnable interface
| Is This Answer Correct ? | 11 Yes | 3 No |
Answer / srinu
Two ways of creating Thread
1)By extending java.lang.Thread class
2)By implementing java.lang.Runnable interface
Here 2"nd way is good because by using interface we can
implement multiple inheritance in our class
| Is This Answer Correct ? | 7 Yes | 0 No |
Is it possible to specify multiple jndi names when deploying an ejb?
How Vector class is synchronized,How to build user defined class as synchronized?
when everything can be done by static block then why do we use main method?.
What is difference between static class and singleton pattern?
Can an exception be rethrown?
What are Advatages of Overloading and Overridding.
What is ‘is-a ‘ relationship in java?
What is a super method?
What does this() represent, and how is it used in Java?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
What is garbage collector?
What is tree node in java?