+ 1

Please! Explain this java io code to me..

import java.io.*; public class CopyFile { public static void main(String args[]) throws IOException { FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream("input.txt"); out = new FileOutputStream("output.txt"); int c; while ((c = in.read()) != -1) { out.write(c); } }finally { if (in != null) { in.close(); } if (out != null) { out.close(); } } } }

17th Sep 2017, 2:40 PM
Gaurav Thakur
Gaurav Thakur - avatar
1 Réponse
+ 8
What exactly don't you understand? File input.txt is read and then output to file output.txt.
17th Sep 2017, 2:45 PM
Tashi N
Tashi N - avatar