public class Demo
{
public static void main(String args[])
{
new Demo();
}
public Demo()
{
try
{
File f = new File("C:\\aa.txt");
FileReader fr = new FileReader(f);
FileWriter fw = new FileWriter("C:\\bb.txt");
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter pw = new PrintWriter (bw,true);
pw.println("subhani");
BufferedReader br = new BufferedReader(fr);
String s =null;
while((s=br.readLine())!= null)
{
System.out.println(s);
pw.println(s);
}
}
catch (Exception e)
{
}
}
}
No comments:
Post a Comment