1class TestMultiThreadSleep implements Runnable {
2 String name;
3 public TestMultiThreadSleep(String name) {
4 this.name = name;
5 }
6 static void main(String[] args) {
7 Thread thread1 = new Thread(new TestMultiThreadSleep("A"));
8 Thread thread2 = new Thread(new TestMultiThreadSleep("B"));
9 Thread thread3 = new Thread(new TestMultiThreadSleep("C"));
10 thread1.start();
11 thread2.start();
12 thread3.start();
13 }
14 @Override
15 public void run() {
16 println "${name} Step 1"
17 sleep(3000)
18 println "${name} Step 2"
19 sleep(3000)
20 println "${name} Step 3"
21 }
22}