Class FileWriter Class FileRead
解决方案 »
- java se 学习笔记分享------from the java tutorials
- 数据库链接出错!新人求助!!!
- httpclient登陆成功后,再执行抓取就跳转到登陆页面,这是为什么?(在线等,马上结贴给分)
- 组件字体的改变
- 用开源的htmlparser,怎么把网页中的script和style标签里面的内容去掉
- 连接SQL2005有问题。。
- hashmap,hashset,treeset,treemap那些需要实现comparator,那些需要实现hashcode()
- JList中如何放入JTextField并且可以编辑(响应用户的操作)?
- 这个错误提示是怎么回事???
- 正在做的一个音符转换程序,遇到无限循环,抓狂中![600分]帖上所有代码,555555555
- AWT中有什么控件可以列有显示小图片吗?比如:SWing中的JTable..
- 在JAVA下能调用WIN32的TAPI.DLL吗?如何实现??
Example based on Sun Java I/O tutorial for File Streams
Reads in a file and copies it out to another file.
*/
import java.io.*; public class Copy {
public static void main(String[] args) throws IOException {
// create two file references
File inputFile = new File("jung.txt");
File outputFile = new File("jungout.txt"); // create two File Streams
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
// read one file and write it out to another
int c; while ((c = in.read()) != -1)
out.write(c); // close both files
in.close();
out.close();
}
}