When I have this code:

```
class A 
{
    public int X = 0;
 ...
}

public void Function()
{
    // here I create a new instance of class
    A a = new A();
    a.X = 10;
    // here I create a pointer to null
    A b = null;
    // here I assign a to b
    b = a;
    b.X = 20;
}

```

did I pass the reference to instance of class A now? or I cloned the instance of A to new instance and created a reference to it in b?

is changing X in b also changing X in a? Why? If not, what is a proper way to create a copy of a and insert that to b?

Why the same with strings would always create a copy? Is equal operator overridden in strings?

```
string a = "hello";
string b = a;
b = "world";
// "hello world"
Console.WriteLine( a + " " + b );

```