// Example of File IO in Java // jcorso // // // see http://www.javathings.com/tij/Chapter11.html // for a full-fledged explanation import java.io.*; public class myio { public static void main(String argv[]) throws IOException { BufferedReader f = new BufferedReader(new FileReader("src.txt")); PrintWriter w = new PrintWriter( new BufferedWriter(new FileWriter("dest.txt"))); String s = new String(); while ( (s = f.readLine() ) != null ) { w.println(s); } f.close(); w.close(); } }