Results 1 to 5 of 5
Like Tree2Likes
  • 1 Post By Norm
  • 1 Post By Norm

Thread: Close a BufferedReader?

  1. #1
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default Close a BufferedReader?

    I'm using a BufferedReader to hold the contents of a text file, which can be opened throughout the entire run of the program. Should I call "close()" on this file before the form closes/the app shuts down? If so, where should I do that?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default

    close it when you are done using it.
    using a BufferedReader to hold the contents of a text file
    Not sure I understand this.
    How does it "hold" the contents of a file?
    You create the BufferedReader but never read from it?
    blackbird likes this.

  3. #3
    blackbird is offline Senior Member
    Join Date
    Jul 2011
    Posts
    100
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    close it when you are done using it.
    Yes, but the user may "use" it up until the time they mash the form's/frame's "close" button in the NE corner. I guess it doesn't matter at that point / Java will zilch everything out, &c?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default

    the user may "use" it up until
    Then you are not done with it until the user says so.

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default

    the user may "use" it up until
    Then you are not done with it until the user says so.
    blackbird likes this.

Similar Threads

  1. How to use BufferedReader?
    By ProgramBeginner in forum New To Java
    Replies: 4
    Last Post: 10-11-2011, 02:56 PM
  2. Replies: 13
    Last Post: 04-09-2010, 11:15 AM
  3. BufferedReader, need help!
    By zacharyrod in forum New To Java
    Replies: 10
    Last Post: 11-19-2009, 10:56 AM
  4. close and reopen BufferedReader
    By Tealoon in forum New To Java
    Replies: 2
    Last Post: 09-14-2009, 03:01 AM
  5. BufferedReader
    By vidhya.sk in forum New To Java
    Replies: 2
    Last Post: 09-18-2008, 01:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •