I have all of my code in java setup, but how would I copy the console's output and have that go to a output.txt file? I have this code at top:
Scanner console = new Scanner(System.in);
System.out.print("Enter Input file name: ");
String inputFileName = console.next();
System.out.print("Output file: ");
String outputFileName = console.next();
File inputFile = new File(inputFileName);
Scanner in = new Scanner(inputFile);
PrintWriter out = new PrintWriter(outputFileName);
It prompts me to enter the input file (input.txt) and the output file (output.txt). When I enter all of my information it creates an output file, but nothing is written in it. I need what the console outputs to be written in the file.