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 |
is java support call by reference and call by value, if supports please explain?
Is 0 an even number?
Which api is provided by java for operations on set of objects?
What is the difference between the boolean & operator and the && operator in java programming?
How to compare strings in java?
What are types of Java applications?
What is substring of a string?
When does a class need a virtual destructor?
To what value is a variable of the Boolean type automatically initialized?
What is bufferedreader in java?
Explain when noclassdeffounderror will be raised ?
what do you mean by classloader?