Search Java Interview Questions
| 2098 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
|Java - Interview Questions and Answers|
|Frequently asked to fresh graduates.|
|Ans. Runnable - waiting for its turn to be picked for execution by the thread schedular based on thread priorities.|
Running - The processor is actively executing the thread code. It runs until it becomes blocked, or voluntarily gives up its turn.
Waiting: A thread is in a blocked state while it waits for some external processing such as file I/O to finish.
Sleeping - Java threads are forcibly put to sleep (suspended) with Thread.sleep. they can resume using Thread.resume method.
Blocked on I/O - Will move to runnable after I/O condition like reading bytes of data etc changes.
Blocked on synchronization - Will move to Runnable when a lock is acquired.
Dead - The thread is finished working.
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve java threads multi threading scheduling thread states basic interview question Cognizant (CTS) basic   frequent|
Try 2 Question(s) Test
| Which keyword is used to provide explicit access of a code block to single thread ? |
|Explain multithreading in Java ?|
|Can constructors be synchronized in Java ?|
|What is the difference between time slicing and preemptive scheduling ?|
|Different ways of implementing Threads in Java ?|
|Difference between Process and Thread ?|
|What is a Deadlock ?|
|Why Struts 1 Classes are not Thread Safe whereas Struts 2 classes are thread safe ?|
|What is race condition ?|