我试图再次运行该程序,现在我得到了这个错误。
这是我的代码:
public static void writeBirdtype() {
private String readFileAsString(String filePath) throws IOException {
StringBuffer fileData = new StringBuffer();
BufferedReader reader = new BufferedReader();
new FileReader(filePath);
char[] buf = new char[1024];
int numRead=0;
while((numRead=reader.read(buf)) != -1){
String readData = String.valueOf(buf, 0, numRead);
fileData.append(readData);
}
reader.close();
return fileData.toString();
}
错误:
Oblig2.java:72: error: illegal start of expression
private String readFileAsString(String filePath) throws IOException {
^
Oblig2.java:72: error: ';' expected
private String readFileAsString(String filePath) throws IOException {
^
Oblig2.java:72: error: ';' expected
private String readFileAsString(String filePath) throws IOException {
^
Oblig2.java:72: error: not a statement
private String readFileAsString(String filePath) throws IOException {
^
Oblig2.java:72: error: ';' expected
private String readFileAsString(String filePath) throws IOException {
^
5 errors
我怎样才能解决这个问题?
非常感谢您的帮助