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 |
Can we create our own wrapper class in java?
What is a ternary operator in java?
What is keyword auto for?
Is java call by value?
What is anonymous class?
What is the difference between the direct buffer and non-direct buffer in java?
How many bytes is a char in java?
What is backdrop?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
What is multi level inheritance in java?
How many types of constructors are used in java?
What is difference between path and classpath?