Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes File-Handling (???) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File-Handling (???)" Watch "File-Handling (???)" New topic
Author

File-Handling (???)

amy emma
Greenhorn

Joined: Feb 19, 2003
Posts: 3
hello, i wanna build a PHONEBOOK DIRECTORY and I'm having a hard time using the file-handling. How can I build a file that can be updated retrieved? How can I search an entry and add entry from/to my directory using the same one file? HELP!
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
What have you tried so far? What have you thought to do?
Luckily, writing and reading a text file from a Java program is not difficult. Following is a simple example program that writes "hello" to a file named "Foo.txt" (which is also created if it doesn't already exist). This program then reads in a line of text from the same file and prints that line of text to the console.Getting any ideas?
Post some simple code of what you're working on. Note: When posting code, please be sure to surround the code with the [code] and [/code] UBB Tags. This will help to preserve the formatting of the code, thus making it easier to read and understand.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
 
subject: File-Handling (???)
 
Similar Threads
Can I deploy a Servlet differently?
How to get log4j directory path
how to add jar files to applet's classpath
Ant error : Missing class in J2ME Polish
determine if file or directory in a web application