Dump Java Program Output to a Text File

Dump Java Program Output into a Text File
Let's see how to dump output of a Java program into a text file. The answer is simple and shorter so is this post. The following command usually is used to run a Java program




java Classname

When you append a small greater than symbol at last followed by the file name. All the output will be dumped. Here will be the new command then.


java Classname >out.txt

*Here the file name is out.txt.

In this way we can dump program output.
You'll have to note that not every thing is dumped into the file, instead what is printed using the program using the standard print methods is printed. The input that the user types or any exceptions that occur are not dumped into the file.


Posted by at on

Tags: Tips,