Sunday, January 31, 2016

[Java] Deep copy VS Shallow Copy

DeepCpoy - > copy instance
Shallow Copy -> copy reference

Interface Cloneable.clone() :
for basic type : int float --> deep copy
for Object type ->shallow copy

String is immutable !

No comments:

Post a Comment