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

What is the java reflection api? Why it’s so important to have?

548


How many types of memory areas are allocated by JVM in java?

586


Can you change array size in java?

525


What are the restrictions imposed on method overriding?

549


Why do we need strings in java?

519






What is a singleton class? Give a practical example of its usage.

587


Explain about static imports in java?

595


How do you check if a string contains only numeric digits?

613


Difference between static and dynamic class loading.

576


What do you mean by inner class in java? Explain

582


Does treeset allow null in java?

504


Write a program to solve producer consumer problem in java?

559


Explain about map interface in java?

583


How do you achieve singleton?

527


What are the disadvantages of object oriented programming?

586