3 public class sleep extends Thread {
4 public static Random r = new Random();
6 public sleep (String name) {
11 for (int i = 0; i < 10; ++i) {
12 System.out.println(getName());
14 sleep((long) (r.nextFloat() * 1000));
15 } catch (Exception e) {
21 public static void main(String args[]) {
22 sleep t1 = new sleep("a");
23 sleep t2 = new sleep("b");