In your
delete
method you call
existList
which does the following:
public int existList(lesson l){
for(int i=0;i<number;i++){
if(listLesson[i].equals(l.getCode())){
return i;
}
}
return -1;
}
Does
getCode()
return the
lesson
object? If not then the equals test will most likely fail. You also declare this method to return an
int
but you try to return a
lesson
on success.