我是使用 jGrasp 的菜鸟。从我所看到的,下面的代码是正确的,但我仍然得到一个错误。我检查了我的 Java 版本,根据 Java 版本检查器它是最新的。
ArrayList<String> item = new ArrayList<String>();
ArrayList<Boolean> completed = new ArrayList<Boolean>();
// Constructor
public ToDoList(String aItem) {
item.add(aItem);
// the following line give error:
// no suitable method found for add(boolean)
completed.add(false);
}