in line 7 I have three errors.
TextFieldOutputDemo.java:7 '.class' expected (where it points to 't' in "throws")
FileOutputStream(String, boolean)throws FileNotFoundException;
TextFieldOutputDemo.java:7 ';' expected (where it points to 't' in "throws")
FileOutputStream(String, boolean)throws FileNotFoundException;
TextFieldOutputDemo.java:7 not a statement (where it points to 'F' in "FileNotFoundException")
FileOutputStream(String, boolean)throws FileNotFoundException;
import java.io.*;
public class TextFieldOutputDemo{
public static void main(String [] args){
BufferedReader br = new BufferedReader (new System.in());
PrintWriter OutputStream = null;
try{
FileOutputStream(String, boolean)throws FileNotFoundException;
OutputStream = new PrintWriter (new FileOutputStream("Sample.txt", true));
}
catch (FileNotFound e){
System.out.println("Error opening file");
System.exit(0);
}
System.out.println("Enter text:");
String line = null;
int ctr;
for(ctr = 1; ctr<=3; ctr++){
line = br.readLine();
OutputStream.println(ctr + " " + line);
}
OutputStream.close();
System.out.println("Lines that have been written:");
}
}