Reputation: 59238
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.
Upvotes: 7
Views: 2209
Reputation: 1502286
Assuming the clone()
call in Java is just calling the Object.clone()
implementation, then I believe they have the same behaviour:
Upvotes: 6