For primitives it doesn't matter. But yes, for objects you will need to call their clone/copy constructors. Additionally, you likely can get away with doing a shallow copy of strings because they're...
Type: Posts; User: helloworld922
For primitives it doesn't matter. But yes, for objects you will need to call their clone/copy constructors. Additionally, you likely can get away with doing a shallow copy of strings because they're...
Java doesn't support copy constructors in the same way C/C++ supports them, but yes, you can write a constructor in Java which will take an object of the same type and construct all the fields back....
If I understand you correctly, that type of association is known as "pass by value".
When you pass by value, the two objects physically exist in different places (depending on how deep your copy...