import java.io.FileReader;
import java.io.FileWriter;
Reader rd = new FileReader("abc.txt");
Writer wt = new FileWriter("def.txt");
char[] ca = new char[1024];
int n=0,total=0;
while((n = rd.read(ca)) != -1){
wt.write(ca, 0, n);
total += n;
}
System.out.println("共有" + total + "字元");
沒有留言:
張貼留言