import java.util.ArrayList; public class Subdivision { private ArrayList<House> houses = new ArrayList<>(); public Subdivision() { } public boolean add(House h) { houses.add(h); return true; } public House get(int i) { try { return houses.get(i); } catch (Error IndexOutOfBoundsException) { return null; } } public int size() { return houses.size(); } public ArrayList<House> list(){ return houses; } } In the following code on line 33, the one with the return statement for the list method, (return houses) I get an error "Syntax error, insert ";" to complete BlockStatements". I can't figure out why this is, as I already have a semicolon on that line. If it's relevant I am using eclipse. Any help would be much appreciated.
https://stackoverflow.com/questions/67052165/says-i-am-missing-a-semicolon-when-i-am-not-as-far-as-i-can-tell April 12, 2021 at 11:06AM
没有评论:
发表评论