This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: PrintWriter again
- To: tromey at cygnus dot com
- Subject: Re: PrintWriter again
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 6 Aug 2000 09:30:14 -0000
- CC: osk at hem dot passagen dot se, java-discuss at sourceware dot cygnus dot com
> Date: Sat, 5 Aug 2000 18:13:48 -0700 (PDT)
> From: Tom Tromey <tromey@cygnus.com>
>
> Oskar> According to the Sun JDK 1.3 api docs, println(whatever) in
> Oskar> PrintWriter should call print(whatever) and then println(). At
> Oskar> least that's how I interpret the documentation:
>
> Oskar> "This method behaves as though it invokes print(boolean) and
> Oskar> then println()."
>
> That "as if" is important.
Humm. Surely the "as if" rule includes subclassing. That means that
in all cases "This method behaves as though it invokes print(boolean)
and then println()." That means, IMO, that a subclass of PrintWriter
behaves in the way that it would do *if* it called print(boolean) then
println(). A pedantic point, perhaps, but I think we ought to
interpret the spec in this strict fashion.
Andrew.