Hi, so recently I’ve been having this specific issue in a project where I have a class that contains a name parameter which I use to grab a file from my laptop. But for some odd reason, every time I finish loading in a set of strings into an array of these classes, the entire array becomes the last element.
I’ve printed every single step of the array as it goes and it works perfectly but as soon as it finishes the entire array suddenly becomes a duplicate of the last element. To combat this I attempted just finishing up the last few lines of my code inside the loop but there’s no way for me to do that efficiently since I would end up nesting different loops and it would increase runtime. I was wondering if this is a general error that happens often under certain circumstances and what I could do to fix this