i have a question and i need some help please.
i have an object, for example Contact , with String name, String adsress and String phone variables
I create an array of this object
Contact[] homeContacts = new Contact[10];
homeContacts[0] = new Contact();
...
...
homeContacts[9] = new Contact();
And i populate every variable like this
homeContacts[0].name="jim"
homeContacts[0].adsress ="Oak road 52"
homeContacts[0].phone="555-6363633"
and i continue with homeContacts[1] and so on
now lets say i create a second array Contact[10]
Contact[] workContacts = new Contact[10];
workContacts[0] = new Contact();
...
...
workContacts[9] = new Contact();
and i copy the values of homeContacts to WorkContacts massively like this
workContacts=homeContacts;
Now every variable of homeContacts array has the same reference with the value of workContacts array! if i change for example a name of work homeContacts[0].name="Peter" it changes also the workContacts[0].name to Peter, but i want to be able to change the homeContacts without affecting the workContacts, how i can copy the values of homeContacts to WorkContacts and give them reference to new pointers and not share the same;
Thank you in advance