which method is used to know the status of the Thread?

Answer Posted / manikandan

isAlive() method is used only to check whether the thread
is running or not.But if you want to know the exact status
of the thread(i.e running,waiting,sleeping etc..) we have
to use getState() method which is been added in jdk 1.5.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is session in java?

742


Difference between start() and run() method of thread class?

586


What is class forname?

543


What do you mean by light weight and heavy weight components?

551


What is the purpose of garbage collection in java?

651






How do you use compareto method?

529


How objects of a class are created if no constructor is defined in the class?

578


How can we create a synchronized collection from given collection?

577


Can we define a package statement after the import statement in java?

574


Why string is immutable with example?

526


Difference between ‘is-a’ and ‘has-a’ relationship in java?

535


What do you mean by ordered and sorted in collections in java?

547


Can we serialize static variables in java?

650


What is complexity and its types?

520


When should I use stringbuffer?

568