Can someone show me code of something simple that pipes the output from one java file to the input of another in Java?
Say you have a file that is called hello.java
that just simply outputs "hello". How would I pipe this output from the command line into another Java program called addWorld.java
that simply adds "world" to the end of the input from hello.java
and then outputs "hello world" on the console screen?
I'm sure it is very simple, but I've looked around and I still don't understand how to do it. I've tried to make an example that is as simple as possible so there isn't a lot of code written so I can just understand what to do in a general case. Thanks.