how many ways to create Thread and which one is good?
runnable interface ot Thread class?

Answers were Sorted based on User's Feedback



how many ways to create Thread and which one is good? runnable interface ot Thread class?..

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

how many ways to create Thread and which one is good? runnable interface ot Thread class?..

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

how many ways to create Thread and which one is good? runnable interface ot Thread class?..

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

Post New Answer

More Core Java Interview Questions

Which of the following is not an isolation level in the JDBC

0 Answers   CTS,


What is a singleton puppy?

0 Answers  


IS method overriding is Duplication of Methods?

5 Answers   CybAge,


What is the finalize method do?

0 Answers  


when we create singleton design then we create private constructtor..so how JVM take private constructor to make object..but it's private..

1 Answers   Ness Technologies,


What is a boolean expression in java?

0 Answers  


What is a get method?

0 Answers  


Why Java is a platform independent language?

6 Answers   Wipro, Zensar,


Why chararray() is preferred over string to store the password?

0 Answers  


what is jms? features of jms

2 Answers   CTS,


what is polymorphism with example?types of polymorphism?

15 Answers   HP, Sigma Solve,


If I only change the return type, does the method become overloaded?

0 Answers  


Categories