Getting illegal start of expression as error
Im trying to run the program again, and now i'm getting this error.
here is my code:
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();
}
error:
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
How can I fix this?
Thanks alot for help
No comments:
Post a Comment