File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaCaps Test 2, Question # 33

 
Tina Ang
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5382
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its answer has nothing to do with IO.

what will it print?
[ April 23, 2002: Message edited by: Ravish Kumar ]
 
John Wetherbie
Rancher
Posts: 1449
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic