Results 1 to 2 of 2

Thread: I/O exercise

  1. #1
    Feldom is offline Member
    Join Date
    Oct 2007
    Rep Power

    Default I/O exercise

    hi there,
    Could you help me with this exercise?
    Write the static method copyFile(String fromFile,String toFile)
    that copys the content of fromFIle to toFile.The fromFIle and toFile are
    data of characters.The description of File,FileReader,FileWriter.Reader,
    Writer is given.

  2. #2
    Bojevnik is offline Member
    Join Date
    Aug 2007
    Rep Power


    Where exactly do you have problems?
    Becuase this exercise seems very "straight-away", you both files one for writing, one for reading then you copy all charackters in a file to another.

    You open files by:
    Java Code:
    FileReader fr = new FileReader(new File(file1));
    FileWriter fw = new FileWriter(new File(file2));
    file1 and file2 are String paths to your files.
    I HATE SMURFS!!!!!

Similar Threads

  1. exercise of recursive method
    By amexudo in forum New To Java
    Replies: 2
    Last Post: 03-09-2008, 05:55 PM
  2. Prob with an exercise
    By jhetfield18 in forum New To Java
    Replies: 4
    Last Post: 02-15-2008, 06:11 PM
  3. Problems with Calendar exercise
    By Jude in forum New To Java
    Replies: 1
    Last Post: 11-20-2007, 07:30 PM
  4. help with exercise
    By e_as're in forum New To Java
    Replies: 3
    Last Post: 09-25-2007, 10:14 AM
  5. help with an exercise calcuting tax
    By e_as're in forum New To Java
    Replies: 7
    Last Post: 08-01-2007, 03:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts