Create try and catch block that opens a file named statistics.txt for output.

Writes the integers 24,
55, and 76 to the file, and then closes the file.

```
PrintWriter outputStream = null;
try
{
outputStream = new PrintWriter(new
FileOutputStream("statistics.txt"));
outputStream.println(24);
outputStream.println(55);
outputStream.println(76);
outputStream.close();
}
catch(FileNotFoundException e)
{
System.out.println("Error opening the file autos.txt");
System.exit(0);
}

```

Computer Science & Information Technology

You might also like to view...

What are some benefits to using a layered model to describe network protocols and operations?

What will be an ideal response?

Computer Science & Information Technology

A small, ____ triangle appears in the upper-right corner of a cell containing a comment.

A. red B. blue C. green D. yellow

Computer Science & Information Technology