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

currentThread() method is static method, so don't need to
create the thread object to call the method..

Below is the correct way ..

Thread t=Thread.currentThread();
System.out.println(t.getName());

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many threads does a core java have?

1071


Give any two differences between C++ and java.

1148


How do weakhashmap works?

1155


What are different types of constants?

1052


Why singleton class is used in java?

1136


What are wrapper classes in java?

1072


How can you handle java exceptions?

1031


What is the purpose of finalization in java programming?

1028


What are aggregate functions explain with examples?

1064


Is 0 an irrational number?

1068


What is import java util arraylist?

1184


What do you mean by Hash Map and Hash Table?

1096


How does compareto work in java?

1039


What is instance means in java?

1051


Can singleton class be inherited in java?

1004