According to the specification, which of the two, Runnable interface and Thread class, is preferred if you only intend to implement the run method? Why?

What will be an ideal response?

For good programming practice, the Runnable interface should be used if only the run method needs to be defined. A subclass of the Thread class should only be used if the program requires the modification or enhancement of the base class (that is, if the program needs to add variables and/or methods that are not in the Thread class).

Computer Science & Information Technology

You might also like to view...

A(n) ________ is a three character code after the period at the end of a filename that is used to designate the type of file represented

Fill in the blank(s) with correct word

Computer Science & Information Technology

Overloaded methods always have the same _________.

a. method name b. return type c. number of parameters d. order of the parameters

Computer Science & Information Technology