Hi Programmers,welcome to ozanecare. In this article i am going to write the program to differentiate Assignment Operator and Clone Method using C#.net programming language. The brief definition of assignment operator.
It perform Shallow copying operation. The Shallow copy can be made by simply copying the reference. str2 simply refers to the same array as str1. see below image. and The brief definition of Clone Method.It perform Deep copying operation. Deep copying means creating a new array and copying over the values.
str2 refers to the different array as str1. see below image.
Assignment vs Clone Method Programming. Programming Differences.