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

What is parsing and its types?

1021


What is the functionability stubs and skeletons?

1098


How can an object be unreferenced?

978


What is variable declaration and definition?

964


What is the final method?

1023


What is the difference between checked exception and unchecked exception?

955


What is singleton pattern?

1035


What is a boolean used for?

1056


What is the difference between logical data independence and physical data independence?

979


How can we access some class in another class in java?

935


How hashmap increases its size in java?

931


What is array length in java?

910


Is string passed by reference in java?

952


FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?

3385


What is the difference between compile-time polymorphism and runtime polymorphism?

933