Chapter 8, problem with "FileDescriptor.out"
Hello
I understand that the last example in chapter eight that covers formatted output is erroneous. It says that you should use "FileDescriptor.out" instead of "new File("...")".
My question:
If i want to use "FileDescriptor.out" in a application, like this:
FormatWriter out = new FormatWriter( new BufferedWriter(
new FileWriter( FileDescriptor.out)), 16);
I run into problems as soon as i create FormatWriter more than once (in different methods).
One (very short) example:
//
FormatWriter out = new FormatWriter(new BufferedWriter(
new FileWriter(FileDescriptor.out)), 16);
out.print("bla, bla...");
out.close();
//
Now, if i try to use the same construct again, in another method nothing will show on standard output, why is that?
Note that I have tried "out.flush();" and "out=null;" without success.
/M
|