import java.io.*;
/**
* The following program demonstrates how you can read text from a
* given file and print it into another file.
*/ public class InputOutputFile {
public static void main(String[] args) throws IOException {
// Reads from the file: C:\\readText.txt BufferedReader br = new BufferedReader(new FileReader("C:\\readText.txt"));
// Prints to the file: C:\\printText.txt PrintStream ps = new PrintStream(new FileOutputStream("C:\\printText.txt"));
// Reads from readText and prints all the lines into printText String line = br.readLine();
while (line != null) {
ps.println(line);
line = br.readLine();
}
}}