How to add characters to EOF?

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?



izomaxAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
objectsConnect With a Mentor Commented:
PrintWriter out = new PrintWriter(new FileWriter("book.java", true));
out.println("book3");
out.close();
0
 
izomaxAuthor Commented:
Is the usage of out.println("book3"); same as system.out.println?

Can I use:

out.println( variable + " added ");

Thanks!
0
 
objectsCommented:
yes
0
All Courses

From novice to tech pro — start learning today.