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

If a multi threaded Java program has started numerous number
of threads, at any point in time how to know which thread is
currently executing/running ?

Answer Posted / namita kapoor

You can check by putting following code in your program

Thread t = Thread.currentThread();
System.out.println("Current Thread: "+t);

Is This Answer Correct ?    36 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to reverse array in place?

1058


What is the use of singleton class?

960


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

1062


What is the protected method modifier?

1039


What does a method signature consist of?

975


Can private class be inherited in java?

1025


Can we clone singleton class in java?

950


Why we go for collections in java?

968


Have you ever used hashtable and dictionary?

1010


What is the difference between stream and buffer?

962


What is jit compiler ?

974


There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

1481


What is tochararray in java?

930


Define nashorn in java8.

1030


In case of inheritance what is the execution order of constructor and destructor?

1122