Skip to content

Instantly share code, notes, and snippets.

View aleem006's full-sized avatar

Aleem Mohsan aleem006

View GitHub Profile
import java.io.File;
import java.io.IOException;
import java.nio.file.CopyOption;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
public class Main {
public static void main(String[] args) throws IOException {
public static void main(String[] args) throws IOException {
File src=new File("C:\\Users\\DELL\\Desktop\\testfile2.txt");
File des=new File("C:\\Users\\DELL\\Desktop\\testfile3.txt");
Files.copy(src.toPath(), des.toPath(), StandardCopyOption.REPLACE_EXISTING);
}