62,616
社区成员
发帖
与我相关
我的任务
分享
public class FileTest {
public static void main(String[] args) throws Exception {
File file = new File("E:\\test.txt");
FileOutputStream fos = new FileOutputStream(file);
byte[] data = "给哥换行去\n\r坑哥居然不换".getBytes();
//byte[] data2 = "新行哟".getBytes();
fos.write(data);
//fos.write(data2);
fos.flush();
fos.close();
}
}
我的代码换行是没有问题的,我用的jdk1.5 且是用notepad++打开的