Hi Friends, can you give difference between extending thread
class and implementing runnable interface.
Answer Posted / abnish kumar rajput
If we are going for using extend with thread then there is
no need to create thread object because we have
automatically all the properties of thread class ,then reuse
all these properties.whereas If are going for implement with
thread then we have to create of thread class and then we
have to override all the methods of thread class.because of
abstract class .
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Which is faster string or stringbuilder?
What is finalize()? Is finalize() similar to a destructor?
Why hashcode is used in java?
How to run a JAR file through command prompt?
What are the high-level thread states in java programming?
What is the synchronized method modifier?
What is a protected class in java?
Can we override private methods?
Which variables are stored in heap?
What is a short in java?
Implement two stacks using a single array.
What are the main uses of the super keyword?
What is substring 1 in java?
What is the function of character?
Can a class be protected in java?