Hello,
I need to write a remove method for an array of 10 things.
So object can can a name. I have a getName() method and others that sort out things. The array can only have 10 objects inside. However when I use this method it doesn't remove anything. I'm not using an arraylist so I can't use those method which would make this way easier.
I start out with
public void remove(Object a){
for(int i = 0; i <= object.length; i++) {
if(this.object[i].getName().equals(a.getName())) {
this.object[i] = null;
}
}
}
any ideas. I understand this is without some information so if you need something more to understand it just ask I will provide it as quick as possible.