当前位置: 代码迷 >> Java相关 >> 关于PrintWriter的问题,请大家帮忙解答!
  详细解决方案

关于PrintWriter的问题,请大家帮忙解答!

热度:288   发布时间:2008-03-29 19:50:30.0
关于PrintWriter的问题,请大家帮忙解答!
.
.
.
PrintWriter out = new PrintWriter (outputFileName);
.
.
.
out.println(a.outputFormat());

a.outputFormat()是我之前定义的一个输出格式的方法:

public String outputFormat()
    {
                return studentID+"\n"+sore+"\n"+teacher+"\n";
    }
    
问题是输出到文本时,格式里没有format的\n了,把student,sore,teacher打在了一排,请问有什么办法解决按format的格式输出结果吗?
搜索更多相关的解决方案: PrintWriter  outputFormat  teacher  format  sore  

----------------解决方案--------------------------------------------------------
请大家帮忙解答下
----------------解决方案--------------------------------------------------------
请大家帮忙解答下啊!
----------------解决方案--------------------------------------------------------
有人能帮帮忙吗?
----------------解决方案--------------------------------------------------------
说说
你的程序不完整,实在不好说啊
----------------解决方案--------------------------------------------------------
在PrintWriter想换行,只有一个办法
你每写一行,就接着调用println()方法。
eg:
程序代码:
PrintWriter out = new PrintWriter ("I:\\downloads\\xwz.txt");
out.println("123123131232132131");
out.println();

----------------解决方案--------------------------------------------------------
感谢了!
----------------解决方案--------------------------------------------------------