My name is David and i have a problem with usage of ArrayLists.
In my program i have defined two ArrayLists as follows:
private ArrayList<Tour> ToursCR; private ArrayList<Tour> ToursUCC;
In the constructor i initialize them as follows:
this.ToursCR = new ArrayList<Tour>(); this.ToursUCC = new ArrayList<Tour>();
In a separate method i try to fill the ArrayLists:
The output is was expecting was that ToursCR and ToursUCC would have different values. Which should also be the case because completely different values are obtained from the methods.
However, after the ArrayList both should have been assigned values it appears that they both have the value of "ToursUCC".
How can i make sure that each ArrayList contains the data it should contain?