I have this method
public void addAttraction(Attraction c) {
}
which needs to add a element (an attraction in this case, c) to an array named Attraction[]. I tried using an ArrayList, and manually entering it using index. But niether seem to work.
This is what I tried:
public void addAttraction(Attraction c) {
c = new Attraction();
}
It needs to give a value of 2 (when the method is used), but I get a 0.