deadlock is a situation which occurs
when two or more threads are waiting to gain control of a resource,Due to some reason the condition on which waiting threads rely on to gain control doesnot happen.
eg.
thread A must acess method1 before it can release Method2,but ThreadB cannot release Method1 until it gets hold of method2
Thread A
synchronized method2()
{
synchronized method1()
{
.....
.....
}
}
Thread B
synchronized method1()
{
synchronized method2()
{
.....
.....
}
}
if u want detail study of deadlock ,read Books on operating System Concepts