how many ways to create Thread and which one is good?
runnable interface ot Thread class?

Answer Posted / guest

Two ways to create threads
1)by creating thread class
class classname extends Thread
{


}
2)By converting class to thread ie using Runnable interface

Is This Answer Correct ?    11 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can execute any code even before main method?

782


What is the use of join method?

798


What is an infinite loop? How infinite loop is declared?

791


What is byte value?

745


What is method reference in java?

820


What are exceptions

838


What do you mean by collectors in java 8?

722


What is a boolean expression in java?

774


Why we go for collections in java?

752


Add a value x to array from index l to r where 0 <= l <= r <= n-1

867


What are scalar data types?

712


What is difference between fail-fast and fail-safe?

860


Is map ordered in java?

711


What is a parameter in simple terms?

756


What are the advantages of unicode?

786