• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reg. close method

 
Angela Narain
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is an explanation from Marcus Green exam#3
(Question 5)

You can create a file in the underlying operating system by passing an instance of a file to a stream such as FileOutputStream. The file will be created when you call the close method of the stream.

I am not clear about the last line regarding using the close().
The file is created even without using it.
 
ashok khetan
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i too join u...i didn't get what it means
ashok.
 
Roopa Bagur
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what the API doc has to say:
close(): Closes this file output stream and releases any system resources associated with this stream.
I think the explanation should have been the file will be released when the close() method is called..
Correct me if I am wrong.
Originally posted by Angela Narain:
Following is an explanation from Marcus Green exam#3
(Question 5)
I am not clear about the last line regarding using the close().
The file is created even without using it.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic