Hi ALL, Following is the question from Barry boones: You can attach a FilterOutputStream object to: a) An underlying file b) Another FilterOutputStream object, c) A filterInputStream object d) all of these. I thought the answer was only b). But the answer is a,b. Only the FileInputstream can attach to an underlying file,so is this answer wrong? Also, I want to understand the InputStream Reader, OutputStreamWriter classes - i am not finding them in the certification books. It just says "They convert between streams of Bytes and sequences of unicode characters". I didn't check the Marcus Site, but can anybody suggest me some reading material for this? Thanks,
I think the answer is either b or d, depending on interpretation. Of the choices listed, you can only directly attach a FilterInputStream to another FilterInputStream. But indirectly, you can attach any of them, through other types of streams. For C, you'd need a PipedInputStream connected to a PipedOutputStream - which is more obscure than you need to worry about for certification I think, but it's possible. Since it's a poorly-worded question, I wouldn't worry about it. (But feel free to write Barry to let him know about the problem.)
"I'm not back." - Bill Harding, Twister
Joined: Feb 23, 2000
Thanks Jim! I agree with u that it is badly worded. I also see now why they could have possible picked "a" as the answer.
Hi all, How we can know that what are the objects that can be attached to other object like eg:FilterOutputStream. I think For FilterOutputStream there is only one constructor which takes the outputstream object.Is this related to above stmt.Can anyone explain this. Thanks and Regards Priya
Hi , The question given in the Barrey bone book is confusing. The main confusion is: a) An underlying file FilterOutputStream takes only one constructor ie. OutputStream or its sub clsses. Filters can be combined, with one filter using the output of another as its input. The question (a) should have been "FileOutputStream" Then (a) is also correct. I thing, the book means that. Since FileOutputStream is a subclass of OutPutStream it is ok. (e.g) BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("test.txt")); Two good certification books on I/O is 1. A PROGRAMMER'S GUIDE TO JAVA CERTIFICATION - K A Mughal& R W Ramussen 2. JAVA2 CERTIFICATION BY Jamie Jaworski solaiappan
[This message has been edited by P SOLAIAPPAN (edited October 24, 2000).]