KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Let me start by saying that I can't put any code here because Internet on my laptop is not working so I am posting this through my phone. Okay the problem is that say I have two classes: class one and two. Class one has an ArrayList as one of its attributes and it calls a void method from class two and passes that ArrayList as a parameter. Now that method initializes another ArrayList and makes it equal to the parameter passed by me and makes changes to that new ArrayList . Funny thing is that even my original ArrayList which was passed as parameter is also changing. What could be the possible reason?
Tags (comma-separated)
Save Edits
Cancel