package def;


/* Brian Goetz
 * slightly modifed: smh 11/17/09, 04/08/14
 * */

public class ThreeThreads { 

	public static class Thread1 extends Thread { 

		public void run() { 
			for (int i=0; i<10; i++) {
				System.out.print("[ ");
				try {
					sleep(0, 1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				System.out.print("] ");
				try {
					sleep(0, 1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
		
				//System.out.println();
				}
			} 
		} 

	public static class Thread2 extends Thread { 

		public void run() {
			for (int i=0; i<10; i++) {
				System.out.print("( ");
				try {
					sleep(0, 1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				System.out.print(") ");
				try {
					sleep(0, 1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

				//System.out.println();
				}
			} 
		}
	
	public static class Thread3 extends Thread { 

		public void run() { 
			for (int i=0; i<10; i++) {
				System.out.print("{ ");
				System.out.print("} ");
				try {
					sleep(0, 1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				try {
					sleep(0, 1);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

				//System.out.println();
				}
			} 
		} 

	public static void main(String[] args) { 
		System.out.println("**START main**");
		new Thread1().start(); 
		new Thread2().start();
		new Thread3().start();
		System.out.println("**STOP main**");
		}
	
}


