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
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
What is the best definition for data?
What is the purpose of a parameter?
What is a container in a gui?
What is difference between final and immutable?
What does \ mean in regex?
Does java map allow duplicates?
What is a parameter in java?
What is the static method?
What purpose do the keywords final, finally, and finalize fulfill?
How listener identify that the event came from a particular object?
How do you compare objects in java?
How do you remove duplicates from an array in java?
What are the rules for variable declaration?
Explain different forms of polymorphism?