[求助]用IO写出的文件不自动换行的问题
写的文件没有另换行,如果解决?谢谢
import java.io.*;
class test
{
public static void main(String[] args) throws IOException
{
BufferedReader in = new BufferedReader(new FileReader("test.java"));
String line = in.readLine();
BufferedWriter out = new BufferedWriter(new FileWriter("1.txt"));
while(line!=null)
{
System.out.println(line);
out.write(line);
line = in.readLine();
}
out.flush();
}
}