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...

In how many ways we can the thread? in java

Answer Posted / virendrasinh gohil

The only way to create a thread is using a thread class.
(Either by extending it or creating object elsewhere).
Runnable does very little contribution here. It's just
that, the thread object expects instance of a class which
should have run() (semantics) method and is called via
runnable interface. Runnable method doesn't create any
thread by itself (sounds dumb as everybody knows Runnable
is an interface).

Calling Thread's start() is the only way in java to spawn a
separate independed execution with in the application.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you invoke any external process in java?

1117


Why chararray() is preferred over string to store the password?

1028


In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

1323


Is array size fixed in java?

976


What is the symbol for space?

1000


State the merge-sort principle and its time complexity.

979


Can two objects have same hashcode?

1001


Explain public static void main(string args[]).

1181


What function extracts specified characters from a string?

1004


Is java owned by oracle?

1018


What is a method header?

1020


What are constructors in java?

1118


Explain method local inner classes ?

1037


What is meant by method overriding?

1113


What is difference between classpath and path variables in java?

1198