DataOutputStream out = new DataOutputStream(new FileOutputStream( "out.txt" ));
 out.writeBytes("The accounts are:");
 out.writeByte('\n');//////// 想实现在文本里重起一行

解决方案 »

  1.   

    要平台中立,使用System.getProperty("line.separator")获得换行符。
    此外,输出文本,你最好使用Writer而不是直接用OutputStream。
      

  2.   

    hax(海曦)  谢了   我在xp下System.getProperty("line.separator")  相对应的  字符是什么
      

  3.   

    \n\r == DOS/WIN
    \n   == Unix/Linux
      

  4.   

    System.getProperty("line.separator")  学习一个