What is more advisable to create a thread, by implementing
a Runnable interface or by extending Thread class?
Answer Posted / devarathnam c,kotagudibanda(po
Hi...To create a Thread ,implement the Runnable interface
it is more advisable than extending a Thread class.By
extending the Thread class u can't achieve the multiple
inheritance.So implementing the Runnable interface is good
programming practice.
public class ThreadTest extends Thread,Applet
//This is illegal
public class ThreadTest extends Applet implements Runnable
//This is legal.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is regex java?
What are the three types of design patterns?
How many functional interfaces does java 8 have?
What is the importance of main method in Java?
What are the differences between Java 1.0 and Java 2.0?
What is a prefix function.write down a code to compute prefix function.
what is inner class in java?
What is an array in java?
How objects of a class are created if no constructor is defined in the class?
Why runnable interface is used in java?
What is array length?
What do you mean by pointer value and address?
What does those terms actually mean included in the j.d.k i.6?
Is java call by value?
Which package is used for pattern matching with regular expressions?