07-IO stream (flujo de caracteres-FileReader-método de lectura dos

package cn.filereader;

import java.io.FileNotFoundException;
import java.io.FileReader;

public class FileReaderTest02 {
		public static void main(String[] args) {
			try {
				FileReader fr = new FileReader("d.txt");
				char [] ch =new char[1204];
				while (fr.read(ch)!=-1) {
					System.out.println(new String(ch));
				}
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
}

 

Supongo que te gusta

Origin blog.csdn.net/qq_41620231/article/details/98884761
Recomendado
Clasificación