Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

android studio program give me “illegal start of type” error?

here is the relevant code snippet:

public static void parsePhotoJson(String jsonString) throws JSONException {
        List<FlickrPhoto> list = new ArrayList<>();

        JSONArray photoArray = new JSONArray(jsonString);

        for (int i = 0; i < photoArray.length(); i++) {
            JSONObject j = photoArray.getJSONObject(i);

if (j.has("width_o") && j.has("height_o"))
                photo.size_o = JsonUtils.getString(j, "width_o") + " * " + JsonUtils.getString(j, "height_o");
            }
        }
        return list;

    }
    }

FlickrPhoto is the name of the class that this method is in)

when compiling it get this error message:

Main.java:245: error: illegal start of type
    return list;
    ^
Main.java:245: error: ';' expected
    return list;
          ^
Main.java:248: error: class, interface, or enum expected
}
^
3 errors

thanks to help me :)

Comments