copy a file in other

Reply Mon 15 Jun, 2009 03:41 pm
/* i want to copy the contents of file "5.txt" to "6.txt" ....the contents of bothe the files are initially as shown

content of "5.txt"
room no 4226

content of "6.txt"
Prateek rawal

import java.io.*;

public class copy
public static void main(String args[])
String s,s2;
String s1=new String();
BufferedReader b1= new BufferedReader(new FileReader("5.txt"));
PrintWriter p= new PrintWriter(new FileWriter("6.txt"),true);
while((s=b1.readLine())!= null)
BufferedReader b2= new BufferedReader(new FileReader("6.txt"));



catch(IOException o)

/*i dont get any compilation error but the output is not desirable...please tell me what is the problem*/
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 1,144 • Replies: 0
No top replies


Related Topics

Clone of Micosoft Office - Question by Advocate
Do You Turn Off Your Computer at Night? - Discussion by Phoenix32890
The "Death" of the Computer Mouse - Discussion by Phoenix32890
Windows 10... - Discussion by Region Philbis
Surface Pro 3: What do you think? - Question by neologist
Windows 8 tips thread - Discussion by Wilso
GOOGLE CHROME - Question by Setanta
.Net and Firefox... - Discussion by gungasnake
Hacking a computer and remote access - Discussion by trying2learn
  1. Forums
  2. » copy a file in other
Copyright © 2022 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 06/30/2022 at 01:31:53