I'm having trouble with the following code. I'm trying to write to a .ppm file, and I get
"Red.java:6: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown" FileOutputStream fout = new FileOutputStream(fileName); ^ Any ideas?
import java.io.*;
public class Red {
public static void main(String args[]) {
String fileName = "RedDot.ppm";
FileOutputStream fout = new FileOutputStream(fileName);
DataOutputStream out = new DataOutputStream(fout);
System.out.print("P6 1 1 255 ");
System.out.write(255);
System.out.write(0);
System.out.write(0);
System.out.flush();
}
}