Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2003, 06:39 AM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Having a problem in chapter 2 Okie BOOK: Beginning Access 2003 VBA 1 August 9th, 2007 10:30 AM
Chapter 5 Problem gogeo BOOK: Beginning Access 2003 VBA 1 October 10th, 2005 10:34 AM
Problem in chapter 7 gpauta JSP Basics 1 June 1st, 2004 04:31 AM
problem in chapter 4 gpauta JSP Basics 3 May 11th, 2004 06:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.