When I do the following.. anything done to Person b modifies Person a (I thought doing this would clone Person b from Person a). I also have NO idea if changing Person a wil
a and b are just two references to the same Person object. They both essentially hold the address of the Person.
There is a ICloneable interface, though relatively few classes support it. With this, you would write:
Person b = a.Clone();
Then, b would be an entirely separate Person.
You could also implement a copy constructor:
public Person(Person src)
{
// ...
}
There is no built-in way to copy all the fields. You can do it through reflection, but there would be a performance penalty.