Reading Data from a File
12. CopyFile Method
Answer:
Probably this would be OK.
CopyFile Method
The copyFiles()
method finally gets down to copying the file. The loop that does the work is just a few statements long!
class CopyMaker { String sourceName, destName; BufferedReader source; BufferedWriter dest; String line; private void copyFiles() { try { line = source. ; // while not End-of-File while ( ) { dest. (line); line = source. ; } } catch ( IOException iox ) { System.out.println("Problem reading or writing" ); } } } |
Question 12:
Click in the blanks.