summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing2209.java
blob: f068ed293fa51dce580656fcfe2d3bb6d0a188b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Listing2209.java */

public class Listing2209
extends Thread
{
  static int cnt = 0;

  public static void main(String[] args)
  {
    Thread t1 = new Listing2209();
    Thread t2 = new Listing2209();
    t1.start();
    t2.start();
  }

  public void run()
  {
    while (true) {
      System.out.println(cnt++);
    }
  }
}