Results 1 to 2 of 2
  1. #1
    kandt is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default Reading and Writing Text Files

    I'm very new to the Java language and have no idea how to do this. I've looked through a couple threads and saw some code dealing with BufferedReader/Writer and FileReader/Writer but still feel lost about them. I'm making a Hangman game for a class project and want to be able to save progress of the game. (More for the general knowledge of how to do it than for the sake of the game) What I need to save are ~30 Strings and ~5 integers. I'm totally lost on how to do this. Would it be easier to include it in the class containing the bulk of the game code, or make a separate class? How do I reference the correct files - do I need to have the directory name in the arguments or will it save/pull from the same directory as the game is? When I publish the program, how will it work then? I'm very ignorant as to this and so is my teacher and she has no time to look it up for me. Thanks in advance to whoever can help me.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    You have a long question here. Step down it first and ask you questions one at a time. Otherwise members who read your question can be mess.

    Seems to me you want to know,

    1. How to read/write text files
    2. Where text files are located
    3. How to design/coding it

    You have to make an attempt first. Search on our community, you can find lots of threads related to text file reading and writing. If you stuck there again, back to here and ask your question clearly.

Similar Threads

  1. Reading/Writing files through Applet
    By Java Tip in forum Java Tip
    Replies: 1
    Last Post: 03-09-2009, 11:45 AM
  2. Reading/Writing to file
    By Doctor Cactus in forum New To Java
    Replies: 2
    Last Post: 10-28-2008, 02:05 PM
  3. Does OS intervene when reading Java text files
    By Tina G in forum Advanced Java
    Replies: 1
    Last Post: 04-07-2008, 02:29 PM
  4. Applet - reading text files packed into JAR file
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-08-2008, 09:15 AM

Posting Permissions

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