What is more advisable to create a thread, by implementing
a Runnable interface or by extending Thread class?

Answer Posted / abcd

Suppose ..you want to work with thread and also with a
class from AWT package.

java rule is that : YOu cannot extend more one class in
your program.

So it is adviseable to implement the runnable interface and
extend any other class which you desire....

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to call one constructor from the other constructor ?

619


How do you get the length of a string in java?

528


What is core java called?

534


Can you call one constructor from another if a class has multiple constructors?

593


Is a method a procedure?

567






What is type conversion in java?

587


Why do we need wrapper classes?

584


What package is math in java?

541


Is hashset ordered java?

599


What is meant by class loader? How many types are there? When will we use them?

520


What are three ways in which a thread can enter the waiting state in java programming?

691


Explain about map interface in java?

599


Is class forname reflection?

527


Why pointers are not used in java?

594


Why do we need wrapper class?

541