how many ways to create Thread and which one is good?
runnable interface ot Thread class?
Answer Posted / 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 |
Post New Answer View All Answers
Why multiple inheritance is not supported by java?
What is :: operator in java?
Why arraylist is used in java?
What are the important methods of java exception class?
What is a class in java?
What is the difference between compare and compareto in java?
Can string be considered as a keyword?
What are the ways in which a thread can enter the waiting state?
Can we use synchronized block for primitives?
What are the advantages and disadvantages of reference counting in garbage collection?
Explain different ways of creating a thread?
Why do we need data serialization?
Is 0 an even number?
How strings are created in java?
What are the differences between checked exception and unchecked exception?