Why didn't this line of code update the object?
<p>Given that there is a class called <code>Point</code> with a <code>float x</code> and  <code>float y</code> component.</p>

<pre><code>class Point
{
    public double x;
    public double y;
    public Point(double x, double y)
    {
        this.x = x;
        this.y = y;
    }
    public Point()
    {
        x = y = 0;
    }
    public override string ToString()
    {
        return string.Format("({0:F2},{1:F2})", x, y);
    }
}
</code></pre>

<p>Why in the <code>mystery1</code> function didn't the point <code>p1</code> get updated to be (11.00, 11.00) since <code>p.x</code> is 11 from the first line?</p>

<pre><code>{
    Point p1 = new Point(11, 22);
    Point p2 = p1;
    int n1 = 33;
    int n2 = n1;

    mystery1(p1, n1);
    Console.WriteLine("n1 = {0}, n2 = {1}", n1, n2);
    Console.WriteLine("p1 = {0}, p2 = {1}", p1, p2);

    mystery2(p2, n2);
    Console.WriteLine("n1 = {0}, n2 = {1}", n1, n2);
    Console.WriteLine("p1 = {0}, p2 = {1}", p1, p2);
}

static void mystery1(Point p, int n)
{
    n = (int)p.x;
    p = new Point(n, n);
}

static void mystery2(Point p, int n)
{
    p.x = 77;
    n = 88;
}
</code></pre>