Results 1 to 2 of 2
Thread: Reading and Writing Text Files
- 11-12-2008, 02:14 AM #1
Member
- Join Date
- Nov 2008
- Posts
- 5
- Rep Power
- 0
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.
- 11-12-2008, 04:15 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,370
- Blog Entries
- 1
- Rep Power
- 25
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
-
Reading/Writing to file
By Doctor Cactus in forum New To JavaReplies: 2Last Post: 10-28-2008, 03:05 PM -
Does OS intervene when reading Java text files
By Tina G in forum Advanced JavaReplies: 1Last Post: 04-07-2008, 03:29 PM -
Applet - reading text files packed into JAR file
By Java Tip in forum Java TipReplies: 0Last Post: 02-08-2008, 10:15 AM -
Reading/Writing files through Applet
By Java Tip in forum Java TipReplies: 0Last Post: 12-15-2007, 09:20 PM
Bookmarks