public static void Main (string[] args) throws IOException { TODO auto-generated Method Stub /* Exercise: Copy a file from C to disk D Ideas * 1.C Disk File is a source of data * Copy to D disk, stating that D disk is the purpose of data storage, there should be a file in this purpose * 2. Read the file in C and write the data to the destination * 3. Since the operation of the text file, as long as the use of character streams can be. */ 1. Create a character read stream object and source correlation FileReader fr= New FileReader ("F:\\demo2.txt");
2. Create a character output stream object that explicitly wants to store the data FileWriter fw= New FileWriter ("Demo5.txt");
3. Read-write operation, reading one, write one. int ch=0; while ((Ch=fr.read ())!=-1) { Fw.write (CH); }
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.