What is the result of the following code?

```
1 String file1 = "oldFile.txt";
2 String file2 = "newFile.txt";
3 String line;
4
5 PrintWriter output;
6 BufferedReader input;
7
8 try
9 {
10 File oldFile = new File( file1 );
11 File newFile = new File( file2 );
12
13 FileWriter outputFile = new FileWriter( file2, false );
14 output = new PrintWriter( outputFile );
15
16 FileReader inputFile = new FileReader( file1 );
17 input = new BufferedReader( inputFile );
18
19 line = input.readLine();
20
21 while ( line != null )
22 {
23 output.println( line );
24 line = input.readLine();
25 }
26
27 }
28 catch( IOException exception )
29 {
30 JOptionPane.showMessageDialog( this, "IOException occurred." );
31 }
32 finally
33 {
34 try
35 {
36 output.close();
37 input.close();
38 }
39 catch( IOExcetpion exception )
40 {
41 JOptionPane.showMessageDialog( this, "IOException occurred." );
42 }
43 }
```


The code copies the contents of oldFile.txt to newFile.txt.

Computer Science & Information Technology

You might also like to view...

What tool on the Design tab is used to group toggle buttons, option buttons, or check boxes?

A. Subform B. Unbound Object Frame C. Rectangle D. Option Group

Computer Science & Information Technology

The biggest reason for rasterizing type is to avoid ____ issues.

A. size B. kerning C. color D. font

Computer Science & Information Technology

Evaluate the expressions and reduce the result to lowest terms.

3/5) — (2/9)

Computer Science & Information Technology

A plaintiff is the party that makes a claim against another party and initiates a lawsuit against another party and initiates a lawsuit

Indicate whether the statement is true or false.

Computer Science & Information Technology