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 the use of jtable?
Is 0 an even number?
Which is easier .net or java?
take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).
I want to re-reach and use an object once it has been garbage collected. How it's possible?
Can we overload final method in java?
What is java algorithm?
Can private class be inherited in java?
What is illegal identifier in java?
What are selection structures?
What is annotation in java?
What are the 3 types of control structures?
What is difference between jdk,jre and jvm?
What happens to the Exception object after handling an exception?
What is variable length arguments in java?