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


Please Help Members By Posting Answers For Below Questions

Which is faster string or stringbuilder?

515


What is finalize()? Is finalize() similar to a destructor?

536


Why hashcode is used in java?

497


How to run a JAR file through command prompt?

712


What are the high-level thread states in java programming?

581






What is the synchronized method modifier?

587


What is a protected class in java?

532


Can we override private methods?

542


Which variables are stored in heap?

537


What is a short in java?

496


Implement two stacks using a single array.

566


What are the main uses of the super keyword?

551


What is substring 1 in java?

585


What is the function of character?

522


Can a class be protected in java?

497