每当我尝试添加一个country到我的ArrayList<country> 继续得到这个错误:unexpected token: (它突出我的countries.add线.我不确定为什么会这样.
class country {
private int mland, mwaters; //mtotalborders;
private String mcenter;
country(int earth, int aqua, String yn) {
mland = earth;
mwaters = aqua;
mcenter = yn;
}
public int getLand() {
return mland;
}
public int getWaters() {
return mwaters;
}
public int getTotalBorders() {
return mland+mwaters;
}
public String getCenter() {
return mcenter;
}
}
country Turkey = new country(16, 7, "No");
country France = new country(22, …Run Code Online (Sandbox Code Playgroud)