I’m converting C# code to Java. There are many different places that relies on .Net MemberwiseClone in the code I’m converting.
It seems that they both make shallow copy. So is it possible to simply replace these calls with Java’s clone()? I want to make sure there are not any minor differences that would cause difficult to fix bugs.
Assuming the
clone()call in Java is just calling theObject.clone()implementation, then I believe they have the same behaviour: