class MyThread_1 extends Thread...{ Object lock; public MyThread_1(Object o) ...{ lock=o; } public void run() ...{ try ...{ synchronized(lock) ...{ System.out.println("Enter Thread_1 and wait"); lock.wait(); System.out.println("be notified"); } }catch(InterruptedException e)...{} }}class MyThread_2 extends Thread...{ Object lock; public MyThread_2(Object o) ...{ lock=o; } public void run() ...{ synchronized(lock) ...{ System.out.println("Enter Thread_2 and notify"); lock.notify(); } }}class MyThread...{ public static void main(String[] args) ...{ int[] in=new int[0];//notice MyThread_1 t1=new MyThread_1(in); MyThread_2 t2=new MyThread_2(in); t1.start(); t2.start(); }}output:Enter Thread_1 and waitEnter Thread_2 and notifybe notified