That value is known as the exit status
The exit status or return code of a process in computer programming is
a small number passed from a child process (or callee) to a parent
process (or caller) when it has finished executing a specific
procedure or delegated task.
Here's a little Java test to demonstrate it
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Foo {
public static void main(String[] args) throws Exception {
if (args.length != 0)
System.exit(Integer.parseInt(args[0]));
ProcessBuilder builder = new ProcessBuilder(Arrays.asList("java", "Foo", "42"));
Process process = builder.start();
System.out.println(process .waitFor());
}
}
compile and run this program without any arguments. It will print
42
This java program starts a child process. When that process ends, it returns the value that was passed to it in System.exit(?)
to its parent process which it then prints out.