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
what is session in java?
Difference between start() and run() method of thread class?
What is class forname?
What do you mean by light weight and heavy weight components?
What is the purpose of garbage collection in java?
How do you use compareto method?
How objects of a class are created if no constructor is defined in the class?
How can we create a synchronized collection from given collection?
Can we define a package statement after the import statement in java?
Why string is immutable with example?
Difference between ‘is-a’ and ‘has-a’ relationship in java?
What do you mean by ordered and sorted in collections in java?
Can we serialize static variables in java?
What is complexity and its types?
When should I use stringbuffer?