1public class Fork {
2 public static void fork2(){
3 Thread t2=new Thread() {
4 public void run() {
5 while (true) {
6 fork1();
7 }
8 }
9 };
10 t2.start();
11 }
12 public static void fork1() {
13 Thread t1=new Thread() {
14 public void run() {
15 while (true) {
16 fork2();
17 }
18 }
19 };
20 t1.start();
21 }
22 public static void main(String[] args) {fork1();}
23}