This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PrintWriter again


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]