To illustrate how a process creates a child process, we created two Java programs:
Child.java is a simple, short program that prints "Hello, World!" to the console. Parent.java compiles the Child.java program and executes it. After the Child.java program returns, Parent.java prints the output that Child.java produced (a.k.a, "Hello, World!") to the screen.
The programs were tested and executed on Windows and Linux, and should also work on Mac.