posted 2 years ago
It's probably already clear, but a Process is an externally running program which was created and started by your Java program. When your program creates a Process, sometimes it's just "fire and forget" but often you want to control that Process.
So think of the Process as being a program which runs at the command line. If you use the command line then you can type there, and then what you type will be treated as input by that program. This source of input is called "stdin" for "standard input". And perhaps you want your Java program, the one which created the Process, to control it by typing at the command line. You do that by connecting to the Process's standard input and writing to it, via that OutputStream which we already talked about. Your output is the Process's input.
Then the Process might respond by writing to the command line, which is called "stdout" for "standard output". Your Java program would want to read that response, which it does by connecting to the Process's standard output and reading from it.
There's also "stderr", for "standard error", which is where the program writes error-related data, usually error messages. At the command line, stdout and stderr both get written there, it's first come first served so they are just mixed together. But under the covers they are separate streams and your Java program can read them separately.
If you're used to running things at the command line then this should all be more or less familiar. But if you haven't ever done that then it might be less obvious. Back in the ancient past programmers always learned how to run things at the command line before starting to write code (because you had to know how to type the line to compile a program with all of its obscure options), but now you can be a programmer for years without ever having used a command line.