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 check string is palindrome without using loop?
What are the elements of java?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
What is java basic concept?
What are the steps involved to write rmi based programs?
How do you represent a space in regex java?
What is the declaration statement?
What is a type parameter in java?
What is argument in java?
What are the different approaches to implement a function to generate a random number?
How do you check if two strings are equal in java?
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
What is the meaning of find and replace?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
what happens when a thread cannot acquire a lock on an object? : Java thread