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
Write a program to reverse array in place?
What is the use of singleton class?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What is the protected method modifier?
What does a method signature consist of?
Can private class be inherited in java?
Can we clone singleton class in java?
Why we go for collections in java?
Have you ever used hashtable and dictionary?
What is the difference between stream and buffer?
What is jit compiler ?
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
What is tochararray in java?
Define nashorn in java8.
In case of inheritance what is the execution order of constructor and destructor?