package thread2;

public class MyThread2 extends Thread {
	String message;

	public MyThread2(String message) {
		this.message = message;
	}

	public void run() {
		while (true) {
			for (int i = 0; i != 10; i++) {
				System.out.println("" + i + " " + message);
			}
			synchronized (this) {
				try {
					wait();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
	}
}

