A good answer might be:Sure, because output.txt is a text file. Once it has been created it is a text file like any other. |
Printing a Program's OutputOne way to print the output of a program is to redirect its output to a text file (as in the previous page), then read the file into Notepad, then used Notepad's print command. Here is a Hello.java program that can be used with "copy-paste-save-and-run" to practice redirection.
Here (again) is this program being used with output redirection:
Of course, you will probably be in a different subdirectory when you do this.C:\users\default\JavaLessons>javac Hello.java compiling: Hello.java C:\users\default\JavaLessons>java Hello > output.txt C:\users\default\JavaLessons>type output.txt Hello World C:\users\default\JavaLessons> |
QUESTION 9:After the above commands have been executed, what happens to the file called output.txt in the subdirectory C:\Myfiles ? Click Here after you have answered the question |