import java.io.*;
class hcqfz
{
public static void main(String[] args)
{
BufferedReader dq=null;
BufferedWriter xr=null;
try
{
dq=new BufferedReader(new FileReader("d://JAVA知识整理.txt"));
xr=new BufferedWriter(new FileWriter("d://JAVA知识整理COPY.txt"));
String n=null;
while((n=dq.readLine())!=null)
{
xr.write(n);
xr.newLine();
xr.flush();
}
}
catch (IOException e)
{
throw new RuntimeException("读写异常");
}
finally
{
try
{
xr.close();
dq.close();
}
catch (IOException e)
{
System.out.println("异常");
}
}
}
}
|