How do you create a PrintWriter to write data to a file? What is the reason to declare throws Exception in the main method in Listing 1, WriteData.java? What would happen if the close() method were not invoked in Listing 1?
LISTING 1 WriteData.java
1 public class WriteData {
2 public static void main(String[] args) throws IOException {
3 java.io.File file = new java.io.File("scores.txt");
4 if (file.exists()) {
5 System.out.println("File already exists");
6 System.exit(1);
7 }
8

We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.