Add elements to Arraylist and it replaces all previous elements in Java
- by pie154
I am adding elements to a ArrayList and it adds the first one correctly but then when I add any subsequent elements it wipes replaces the other elements with the value form the most recently added and adds a new element to the ArrayList.
I ran test using arraylist and ints and even another created class and it worked perfectly but soemthing about…