// TODO: // 读取input.txt,写入output.txt: try (InputStream input = new FileInputStream(source); OutputStream output = new FileOutputStream(target)) { input.transferTo(output); // transferTo的作用是? }
写的比较简单 但是坑真的不少
命令行参数:java com.itranswarp.learnjava.CopyFile C:\test\input.txt C:\test\output.txt
顺便感谢一下这篇帖子:Java————错误:找不到或无法加载主类_奔跑的狮子-CSDN博客_找不到或无法加载主类
Sign in to make a reply
求女票上微博
// TODO:
// 读取input.txt,写入output.txt:
try (InputStream input = new FileInputStream(source);
OutputStream output = new FileOutputStream(target)) {
input.transferTo(output); // transferTo的作用是?
}
写的比较简单 但是坑真的不少
命令行参数:java com.itranswarp.learnjava.CopyFile C:\test\input.txt C:\test\output.txt
顺便感谢一下这篇帖子:Java————错误:找不到或无法加载主类_奔跑的狮子-CSDN博客_找不到或无法加载主类