static void Main(string[] args) { classA ClassA = new classA(); WriteLine($"ClassA.State = {ClassA.State}"); classA.classB ClassB = new classA.classB(); ClassB.setPrivateState(ClassA, 999); WriteLine($"ClassA.State = {ClassA.State}"); ReadKey(); }
public void setPrivateState(classA target, int newState) { target.state = newState; }