Opening file in append mode

How can I open an existing file in append mode and add some texts to it. A code snippet will be highly appreciated.
Who is Participating?
heyhey_Connect With a Mentor Commented:
PrintWriter writer = new PrintWriter(new FileOutputStream(name, true));
writer.print("new line");

you can use FileOutputStream("data", true) too
Read the foll.

public FileWriter(String fileName,
                  boolean append)
           throws IOException

if append flag is true, and the file is
exist it will open the file in append mode.
 so after that
 fileWriterObj.write() will write
info. to file.
dipak_kr_ghoshAuthor Commented:
Thanks to rameshaa also.
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed.  Also a question is posted there specific to these changes that apply to the experts here.  Also, I am including the link to our All Topics, since many new ones have recently been added.
Thank you,
Moderator @ Experts Exchange
All Courses

From novice to tech pro — start learning today.