Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / balaji@cse@crr engg@eluru

types of creating thread
1)extend thread class
2)implement by runnable interface
=>2"nd method is good because by using interface we can
implement multiple inheritance

Is This Answer Correct ?    16 Yes 0 No

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

Answer / 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

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

Answer / srinu

Two ways of creating Thread
1)By extending java.lang.Thread class
2)By implementing java.lang.Runnable interface
Here 2"nd way is good because by using interface we can
implement multiple inheritance in our class

Is This Answer Correct ?    7 Yes 0 No

Post New Answer

More Core Java Interview Questions

Is it possible to specify multiple jndi names when deploying an ejb?

0 Answers  


How Vector class is synchronized,How to build user defined class as synchronized?

0 Answers  


when everything can be done by static block then why do we use main method?.

2 Answers  


What is difference between static class and singleton pattern?

0 Answers  


Can an exception be rethrown?

4 Answers   Wipro,


What are Advatages of Overloading and Overridding.

8 Answers   TCS, Wipro,


What is ‘is-a ‘ relationship in java?

0 Answers  


What is a super method?

0 Answers  


What does this() represent, and how is it used in Java?

2 Answers  


I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?

0 Answers  


What is garbage collector?

0 Answers  


What is tree node in java?

0 Answers  


Categories