Java Interview Questions

BY Author

Java – Interrupting a Thread

A thread can be interrupted explicitly by invoking an interrupt() method on it, but only if a thread is in sleeping or in waiting state. Otherwise, a thread will not get interrupted.After invoking an interrupt() method on a thread, this method waits to interrupt a running thread until it gets into sleeping or waiting state.