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
How to make a non daemon thread as daemon?
How many arguments can be passed to main ()?
What modifiers are allowed for methods in an interface?
What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?
What are benefits of java?
What is class array in java?
How does linkedlist work in java?
What is arrays fill in java?
Is 0 an even number?
Can we cast any other type to boolean type with type casting?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
Give example to differentiate between call by value and call by reference.
Which variables are stored in heap?
Can main() method in java can return any data?
What is bubble sorting in java?