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
What is overloading and overriding in java?
Can we overload final method in java?
When super keyword is used?
Is 0 an even number?
Can we override final method?
how to create constants in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
What is an array in java?
What are the 2 types of java programs?
Is it possible to compare various strings with the help of == operator? What are the risks involved?
Outline the major features of java.
What is the final class?
What is a variable declaration?
Explain about the performance aspects of core java?
What sorting algorithm does javascript use?