This preview shows page 1. Sign up to view the full content.
Unformatted text preview: the new data are written into it If file doesn't exist, an empty file is created PrintWriter out = new PrintWriter("output.txt"); Writing Text Files Use print and println to write into a PrintWriter : You must close a file when you are done processing it: Otherwise, not all of the output may be written to the disk file out.println(29.95); out.println(new Rectangle(5, 10, 15, 25)); out.println("Hello, World!"); out.close();...
View Full Document
This note was uploaded on 06/16/2008 for the course CSIS 2102 taught by Professor Teneja during the Spring '07 term at Stockton.
- Spring '07