@@ -0,0 +1,1050 @@
+package com.dw.lib;%0D%0A%0D%0A//@example: Java Thread - Notify and Wait%0D%0Apublic class OutputThread implements Runnable %7B%0D%0A%0D%0A    private int num;%0D%0A    private Object lock;%0D%0A    private int count = 0;%0D%0A    %0D%0A    public OutputThread(int num, Object lock) %7B%0D%0A        super();%0D%0A        this.num = num;%0D%0A        this.lock = lock;%0D%0A    %7D%0D%0A%0D%0A    public void run() %7B%0D%0A        try %7B%0D%0A            while(count++%3C10)%7B%0D%0A                synchronized(lock)%7B%0D%0A                    lock.notifyAll();%0D%0A                    lock.wait();%0D%0A                    System.out.println(num);%0D%0A                %7D%0D%0A            %7D%0D%0A        %7D catch (InterruptedException e) %7B%0D%0A            // TODO Auto-generated catch block%0D%0A            e.printStackTrace();%0D%0A        %7D%0D%0A        %0D%0A    %7D%0D%0A    %0D%0A    public static void main(String%5B%5D args)%7B%0D%0A        final Object lock = new Object();%0D%0A        %0D%0A        Thread thread1 = new Thread(new OutputThread(1,lock));%0D%0A        Thread thread2 = new Thread(new OutputThread(2, lock));%0D%0A        %0D%0A        thread1.start();%0D%0A        thread2.start();%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

add eclipse Thread notify wait and sequence output