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

Why arraylist is used in java?

763


Is cout buffered?

884


What is difference between array and arraylist in java?

697


How do you insert a line break?

682


What happens if we don’t override run method ?

765


What is a generic data type?

742


What makes a function well defined?

764


What is thread safe in java?

732


Is void a keyword in java?

794


Why is the type for real numbers called double?

729


Explain about strings in java?

820


Why do we override tostring method in java?

686


What is string variable?

797


What is encapsulation in java?

849


What does main method?

777