Import the Java. IO. FileReader;
Import the Java. IO. The File;
Public class FileReadTest {
Public static void main (String [] args) throws the Exception {
The File file4=new File (" c: \ \ info3 TXT ");
FileReader fr=new FileReader (" file4 ");
Char [] data=https://bbs.csdn.net/topics/new char [file4 (int). The length ()];
Fr. Read (data);
fr.close();
String MSG=new String (new String (data));
System. The out. Println (MSG);
}
}
Packing list c downstream info3. TXT file excuse me why abnormal novice couldn't find how to solve,
CodePudding user response:
FileReader fr=new FileReader (file4);CodePudding user response:
FileReader fr=new FileReader (file4);The current project directory without this file
CodePudding user response:
Ok understand or not carefulCodePudding user response:
carefullyCodePudding user response:
To create a new directory is ok, before I tried like the file can't read dish under the root directory