File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes address book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "address book" Watch "address book" New topic
Author

address book

sam jones
Greenhorn

Joined: Aug 09, 2008
Posts: 5
alright so i am working on a address book program in java, but i have run into a rather large problem. i do not know how to write to an output file w/o erasing the info that is already there (using printwriter). write now the program just gets input and writes it out, i am trying to fix this problem before i do anything else with it.



Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You can create a PrintWriter by explicitly handing it a FileWriter. java.io.FileWriter itself has several constructors -- follow the link and carefully read the Javadocs for each of the constructors. I promise you will find your solution quickly!


[Jess in Action][AskingGoodQuestions]
sam jones
Greenhorn

Joined: Aug 09, 2008
Posts: 5
worked perfectly, thanks for the help
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: address book
 
Similar Threads
Problem Using PrintWriter class !
Values are assigning null
Pesudo coding
NullPointerExcpetion Help
err get and set methods and scanner class / JOptionPane