Ok here is a program I am working on for an assignment.
import java.io.*;
public class Copy {
public static void main(String[] args) throws IOException {
File inputFile = new File("p1.txt");
File outputFile = new File("p2.txt");
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1)
out.write(c);
in.close();
out.close();
}
}
Now it works fine and everything, the problem is that I want it to print the outputFile to the screen when I run the application. And I can't figure out how! Our teacher would only say that it has something to do with a buffered reader, and I have never been very talented at those. :cry: If anyone could help with this I would really appreciate it.