PROGRAM:
import
java.io.*;
class FileCopy
{
public
static void main(String a[])throws IOException
{
byte b[]=new byte[100];
FileInputStream fis=new
FileInputStream("Test1.txt");
fis.read(b);
FileOutputStream fos=new
FileOutputStream("Test2.txt");
fos.write(b);
System.out.println("\nFile has been Copied!.");
}
}
OUTPUT:
(i)Test1.txt:
Welcome to MCA lab
(ii)Test2.txt:
Welcome to MCA lab
File has been Copied!.
No comments:
Post a Comment
Thanks for your valuable comments