所以基本上我的代码看起来像这样
supersetRowModel.setExerciseModelList(exerciseModelList);
exerciseModelList.clear();
我这个班级的吸气者和设定者
public void setExerciseModelList(List<ExerciseModel> exerciseModelList){
this.exerciseModelList = exerciseModelList;
}
public List<ExerciseModel> getExerciseModelList(){
return exerciseModelList;
}
每当我清除数组列表后立即调用getExerciseModelList()时,它会返回一个大小为0的列表。我已检查并确保exerciseModelList不是大小0.这让我感到困惑,因为清除exerciseModelList不应该影响对象arraylist,因为它已经设置,对吗?