Why does java have two ways to create child threads?



Why does java have two ways to create child threads?..

Answer / Ankur Misra

In Java, you can create new threads using the Runnable interface or by extending the Thread class. The Runnable interface provides a higher level of abstraction and is more flexible since it allows creating threads without inheriting any methods from the Thread class. On the other hand, extending the Thread class creates a subclass that already has all the necessary thread-related methods implemented.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

is java support call by reference and call by value, if supports please explain?

5 Answers  


Is 0 an even number?

1 Answers  


Which api is provided by java for operations on set of objects?

1 Answers  


What is the difference between the boolean & operator and the && operator in java programming?

1 Answers  


How to compare strings in java?

1 Answers  


What are types of Java applications?

14 Answers  


What is substring of a string?

1 Answers  


When does a class need a virtual destructor?

1 Answers   Flextronics,


To what value is a variable of the Boolean type automatically initialized?

3 Answers  


What is bufferedreader in java?

1 Answers  


Explain when noclassdeffounderror will be raised ?

1 Answers  


what do you mean by classloader?

1 Answers  


Categories