Shallow copy by using Memberwiseclone() method
<pre><code>class Test:ICloneable
{
    int a;

    Test()
    {  
        a = 20;
    }

    public int Data
    {
        set
        {
            a= value;
        }
    }

    object Clone()
    {
        this.MemeberWiseClone();
    }
}

Test a = new Test();
Test b = a;
</code></pre>

<p>Now, if we modify the data a, b also changes</p>

<p>Question 1: </p>

<p>When the assignment happens which function is called, is the <code>MemberwiseClone()</code> of the System.object called</p>

<p>Question 2:</p>

<pre><code>Test a = new Test();
Test b = (Test) a.Clone();
</code></pre>

<p>If you change the data of a , b doesn't change, it is because of the shallow copy.</p>

<p>Does <code>MemberwiseClone()</code> creates new object and then does a copy?</p>
