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 / ankush sharma

We can check the current Thread name as
Thread t= new Thread.currentThread();
System.out.println(t.getName());

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between abstract classes and interfaces in java?

590


What are the 6 mandatory procedures for iso 9001?

522


What are the advantages of packages in java?

567


What is wrapper class html?

521


In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

828






What is the use of arraylist class in java?

543


What is ++ a in java?

561


What is data type example?

541


Explain different forms of polymorphism?

644


What is byte data type?

540


What is module in project?

508


Which command from the jdk compiles a java program?

477


What is the use of StringTokenizer class?

603


How do I convert a string to an int in java?

543


What is a control variable example?

524