PrintWriter again

Andrew Haley aph@pasanda.cygnus.co.uk
Sun Aug 6 02:30:00 GMT 2000


> 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.




More information about the Java mailing list