Am confused abt locks...can u explain what is concept of lock...in following code i have two thread objects _th1,_th2 can anyone explain who will acquire the lock becoz they themselves are thread object...i am nt still able to get that "thread will acquire the lock on object.." here what is thread and object ? pls clearly distnguish between thread and object..
class ThreadExample extends Thread{
public void run(){
System.out.println("Execting run");
}
}
public class ThreadSim {
public static void main(String args[]){
ThreadExample _th1 = new ThreadExample();
_th1.start();
ThreadExample _th2 = new ThreadExample();
_th2.start();
}
}