相关代码 |
|
//fReader.Java import java.io.*; public class fReader { public static void main(String[] args) throws IOException{ char c[]=new char[500]; FileReader fr=new FileReader("c:\\java\\test.txt"); int num=fr.read(c); String str=new String(c,0,num); System.out.println("The number of the charactor:"+num); System.out.println(str); } }