Hi Friends, can you give difference between extending thread
class and implementing runnable interface.

Answer Posted / murali.25

both will achieve the same functionality. Usually we implement runnable interface because if we extend thread and if we want to any application specific class, its not possible because java doesnt support multiple inheritance.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between arraylist and linkedlist in java?

706


What are actual parameters?

748


what r advatages of websphere? & how to deploy?

1857


what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????

2021


what do you mean by classloader in java?

787


Is it possible to compare various strings with the help of == operator? What are the risks involved?

847


How do you classify Dialog Box?

847


How do you start a thread?

776


How do you remove duplicates from an array in java?

721


How many types of gc are there in java?

756


What is command line argument

943


What is the difference between the direct buffer and non-direct buffer in java?

787


What is the use of default method in interface in java? Explain

751


What are different data types?

770


Give reasons supporting that string is immutable.

718