Solved

How to add characters to EOF?

Posted on 2004-10-04
3
210 Views
Last Modified: 2010-03-31
If I have a file named book.java

and it contains:

book1
book2

now I want to add book3 to make it:

book1
book2
book3

how do I do that? How do I seek to the EOF?



0
Comment
Question by:izomax
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 12222635
PrintWriter out = new PrintWriter(new FileWriter("book.java", true));
out.println("book3");
out.close();
0
 

Author Comment

by:izomax
ID: 12222651
Is the usage of out.println("book3"); same as system.out.println?

Can I use:

out.println( variable + " added ");

Thanks!
0
 
LVL 92

Expert Comment

by:objects
ID: 12222664
yes
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 53
maven project error 5 56
Opening PDF on button click and fill new document 2 39
Tomcat: Unable to run tomcat service. 2 20
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question