コード例 #1
0
        static void Main(string[] args)
        {
            // firstly we build a object using new instantiation
            Person person = new Person();

            //next time we will clone that object by theh function copyclone.
            // we will also pass the name param dynamically.
            // clone1
            Person person1 = person.CopyClone();

            person1.Name = "Hlaing";

            // clone2
            Person person2 = person.CopyClone();

            person2.Name = "Tin";


            Console.WriteLine(person1.Name);
            Console.WriteLine(person2.Name);
        }