File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes JavaCaps Test 2, Question # 33 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "JavaCaps Test 2, Question # 33" Watch "JavaCaps Test 2, Question # 33" New topic
Author

JavaCaps Test 2, Question # 33

Tina Ang
Ranch Hand

Joined: Mar 12, 2002
Posts: 58
Hello! Could anyone please explain why the answer is C) While writing to the stream f.write(buffer[i]) throws an IOException



Thank you!
TINA
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
Its answer has nothing to do with IO.

what will it print?
[ April 23, 2002: Message edited by: Ravish Kumar ]

"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
John Wetherbie
Rancher

Joined: Apr 05, 2000
Posts: 1441
f1 is an alias for f. That is, the object references with the names f and f1 refer to the same object. So f1.close() is the same as f.close(). When you try to write with a closed Writer you receive an IOException.
John


The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaCaps Test 2, Question # 33
 
Similar Threads
FileWriter, File Created but no content
JavaCaps Test 2, Question # 34
append method
Question from Practice exams
NoClassDefFoundError