📄 filecopy.java
字号:
import java.io.*;
public class FileCopy
{
public void copy(String source,String target)
{
FileInputStream from;
FileOutputStream to;
int i;
try
{
from = new FileInputStream(source);
to = new FileOutputStream(target);
while((i=from.read())!=-1) to.write(i);
from.close();
to.close();
System.out.println("复制完成!");
}
catch(IOException ex)
{
System.err.println("复制操作失败!");
}
}
public static void main(String[] args)
{
FileCopy fc = new FileCopy();
fc.copy(args[0],args[1]);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -