how will the following code execute..
class demo extends Thread{
static Object lock = new Object();
static Object lock = new Object();
int i,j,k;
demo()
{
start();
}
public void run()
{
doit();
check();
}
doit()
{
synchronized(lock1)
{
i++;
}
synchronized(lock2)
{
j++;
}
synchronized(lock1)
{
k++;
}
}
check()
{
}
public void main(
String args[])
{
demo d = new demo();
}
my problem is will the code sync(lock2 ) for lock 1 will be bypassed or what will happen???