File file; /* defines file to be object of class File */
|
try{
-
file = new File("filenameyouwant");
-
. . . . .
-
file.write("stuff put out");
|
} catch (IOException e) {
-
/* This catches ALL I/O errors including
-
/* Handle Exception somehow */
|
return;
|
}
|
/* but the optional finally clause will be executed
-
whether or not code terminates normally */
|
finally {
|
}
|