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 are the pillars of java?
What is the difference between procedural and object-oriented programs?
Does isempty check for null?
What is class??
What is hash table in java?
What is one third plus one third as a fraction?
What is the use of StringTokenizer class?
Does java runtime require a license?
What are the restrictions imposed on method overriding?
Why is java called the platform independent programming language?
What are the rules for variable declaration?
How do you define a method?
What is bubble sort in java?
How do you write a scanner class in java?
How do you create a bulleted list?