【发布时间】:2021-09-14 21:01:34
【问题描述】:
static Location fetchById(int id) {
List<Location> locations = Location.fetchAll();
for (var i = 0; i < locations.length; i++) {
if (locations[i].id == id) {
return locations[i];
}
}
return null;
}
// 如果条件不为真,则当我尝试返回 null 或 false 时返回 null “位置”的类型。
【问题讨论】: