Article View: borland.public.jbuilder.java.api
Article #730a question about PrintWirter.
From: Zhilei Ma
Date: Tue, 26 Nov 2002 16:55
Date: Tue, 26 Nov 2002 16:55
30 lines
1694 bytes
1694 bytes
Hello all,
i habe wrote a code piece like the following:
import java.io.*;
public class PrintWriterDemo
{
public static void main(String[] args) throws IOException
{
PrintWriter pw = new PrintWriter(System.out, false);
pw.println("this is a String.");
int i=-7;
pw.println(i);
double d = 2.4e-7;
pw.println(d);
}
}
when i run this programm, it output nothing, until i changed the parameter
of the constructor of PrintWriter from "false" to "true". I know that the
boolean paremeter means that "autoFlush - A boolean; if true, the println()
methods will flush the output buffer". But i cann't good understand it. Can
anyone explain it to me?
Thanks a lot!
Zhilei
Technical Details
Message-ID:
<3de3a784@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!colt.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news1.dtag.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,ddacbbc68ab6ea40,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-11-26 09:05:06 PST From: "Zhilei Ma" <zhilei.ma@iao.fhg.de> Newsgroups: borland.public.jbuilder.java.api Subject: a question about PrintWirter. Date: Tue, 26 Nov 2002 17:55:49 +0100 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 80.131.48.129 Message-ID: <3de3a784@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038329732 80.131.48.129 (26 Nov 2002 08:55:32 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!colt.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news1.dtag.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail