CopyFile Method

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page        

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 (  )
       {
         dest. (line);
         line = source. ;
       }
     }
     catch ( IOException iox )
     {
       System.out.println("Problem reading or writing" );
     }
   }
}

QUESTION 12:

Click in the blanks.