wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Reg. close method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Reg. close method " Watch "Reg. close method " New topic
Author

Reg. close method

Angela Narain
Ranch Hand

Joined: Apr 14, 2001
Posts: 327
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

Joined: Jul 29, 2001
Posts: 153
i too join u...i didn't get what it means
ashok.
Roopa Bagur
Ranch Hand

Joined: Nov 03, 2000
Posts: 267
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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg. close method
 
Similar Threads
what operation does inputStream.close() does?
Doubt
Doubt
How to create MS Word Doc using HWPF POI
File I/O R/W + Permission Issue