Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  sa
Language: JAVA
Code:
import java.io.*; 
public class FileToFile1
 { 
     public static void main(String args[]) 
{ try
 { 
   FileInputStream fis = new FileInputStream("pqr.txt"); 
   FileOutputStream fos = new FileOutputStream("xyz.txt");   
    int k;

 while( ( k = fis.read() ) != -1 ) 


fos.write(k); 
System.out.print((char) k); 

fos.close(); 
fis.close(); } catch(FileNotFoundException e) { System.out.println("File does not exist. " + e); } catch(IOException e) { System.out.println("Some I/O problem. " + e); } } } - See more at: http://way2java.com/io/semantics-of-file-copying/#sthash.TDs5h2hQ.dpuf
Comments: