If I have a class that contains properties with private set and protected set accessibility levels set, will I be able to change those properties on another instance of the same class?
Note: I'm not on a machine which I can test this on right now, otherwise I'd just run the code below.
For instance:
public class Foo
{
public string A {get; private set;}
public string B {get; protected set;}
public void Bar()
{
var someOtherFoo = new Foo();
// Does this change someOtherFoo's A?
someOtherFoo.A = "A";
// Does this change someOtherFoo's B?
someOtherFoo.B = "B";
}
}