Solved

How to add characters to EOF?

Posted on 2004-10-04
3
206 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now