> >I 'm trying to output the result from a class called lexical, and CLASS
> > lexical uses PrintWriter as an output stream.
[quoted text clipped - 20 lines]
> --
> Thomas
First off, you can't actually create an new OutputStream, because
OutputStream is an interface rather than a class. Second, I doubt that
Thomas's suggestion will do what it is that you want it to do, since it
will reassign the output from the stream to the console, and not write
to the file.
To print to the console as well, you will either have to use the
System.out.print() method every time you write to the file (with the
same parameters) (Thomas's link will explain the System.out.print()
method, and its cousin, the System.out.println() method), or edit the
lexicon class so that it will do this for you every time you write
something to the file.
Depending on your experience in Java, you could also subclass
FileOutputStream, and overload its write() method to use
System.out.print() in addition to whatever it normally does. If you do
that, then remember to set lexicon's outputStream in a way to reflect
this change.
-0daedalus
Dale King - 08 Dec 2006 13:38 GMT
> First off, you can't actually create an new OutputStream, because
> OutputStream is an interface rather than a class.
For the record, OutputStream is an abstract class, not an interface.

Signature
Dale King