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
Which collections are thread safe in java?
Do we have pointers in java?
What steps are taken when the OS shifts from one-thread execution to another?
What is the purpose of sizeof operator?
what is the difference between a threads start() and run() methods? : Java thread
What are desktop procedures?
What is ordered map in java?
Variables used in a switch statement can be used with which datatypes?
Why javac is not recognized?
How to change the priority of thread or how to set the priority of thread?
What is the difference between reader/writer and inputstream/output stream?
Write a program to search a number in the given list of numbers.
What is an anonymous class in java?
Is arraylist zero based?
What is static import?