I know when using C++ you can do the following to read in a list of commands from a text file, run them against the program, and output the results to a text file:

ExampleProg < test.txt > results.txt

Can anyone tell me how to get the same result, but using a Java program. I do most programming in an IDE, so I'm not all that great with knowing what commands need to be done at the command line.

Is it something like the following?

java ExampleProg < test.txt > results.txt