把java2.txt内容复制到java.txt中

 

import java.io.File;

import java.io.IOException;

import java.nio.file.Files;

import java.nio.file.Path;

import java.nio.file.Paths;

import java.nio.file.StandardCopyOption;



File f=new File("c:/java2.txt");

Path targetPath = Paths.get("c:/java.txt");        

Files.copy(f.toPath(), targetPath, StandardCopyOption.REPLACE_EXISTING);

相关文章:

  • 2021-09-10
  • 2021-10-31
  • 2021-09-25
  • 2021-11-17
  • 2022-12-23
  • 2021-05-26
猜你喜欢
  • 2021-11-05
  • 2021-05-15
  • 2021-07-16
  • 2021-06-08
  • 2021-11-18
  • 2021-10-06
相关资源
相似解决方案