I have changed around some things and am getting 1 last error. The program reads from keyboard and writes out to DebugTwelve1Data.dat
The error Im getting is:Code:
// This program reads from the keyboard
// and writes to a file
public class DebugTwelve1
public static void main(String args) throws IOException //Added exception to throw
final int EOF = -1;
File outputFile = new File("DebugTwelve1Data.dat");
istream = System.in;
ostream = new FileOutputStream(outputFile);//Moved from main.
System.out.println("Enter characters. Type Ctrl + Z to quit");//Moved from main
while((c = istream.read())!= EOF)//Was set to write when EOF was reached. You have to write until EOF is reached.
catch(IOException e)//Added error type to catch
System.out.println("Error: " + e.getMessage());
C:\Users\Tyler\Documents\School Work\CIS280\Project 8>javac DebugTwelve1.java
DebugTwelve1.java:34: variable ostream might not have been initialized