Skip to content

Instantly share code, notes, and snippets.

@aleem006
Created September 27, 2017 10:01
Show Gist options
  • Save aleem006/1b0883d5b80896ca04e00faa7621b923 to your computer and use it in GitHub Desktop.
Save aleem006/1b0883d5b80896ca04e00faa7621b923 to your computer and use it in GitHub Desktop.
Copying a File
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment