why Runnable interface is preferable than extending the
Thread class?

Answer Posted / susheeel

Many Java programmers feel that classes should be extended
only when they are enhanced or modified in some way.So,if
you will not be overriding any of Thread's other methods,it
is probably best simply to implement Runnable.

Is This Answer Correct ?    32 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the importance of finally block in exception handling?

796


why we use merge option in hybernate pls give a ex snippet

1710


Is a method a function?

819


What is a copy constructor in java?

829


Explain about interrupt() method of thread class ?

887


Can we use catch statement for checked exceptions?

768


Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).

2466


how to create multithreaded program? : Java thread

723


What are java annotations?

848


What are default methods ?

797


What is the escape character in java?

743


Why object class is super class for every class in java?

817


What is the role of garbage collector in java?

732


What is a dot notation?

783


Why pointers are not used in java?

853