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

Is null function in java?

564


Can we convert stringbuffer to string?

561


What is pojo class in java?

534


How would you dynamically allocate memory to an array?

591


What is the use of put method?

514






What does main method?

558


Why string is called as immutable?

522


Why object class is super class for every class in java?

568


Tell me about your ability to work under pressure

1765


What are generic methods?

527


What is instance means in java?

562


What is the difference between post and put?

533


What is Mutex (Mutual Exclusion Object) ?

621


What is the difference between size and length in java?

506


Explain the concept of hashtables?

611