I just tried to create this simple implementation:
class Test
{
private int abc = 0;
public class TestClass
{
private void changeABC()
{
abc = 123;
}
}
}
If I compile it, it will complain:
Cannot access a non-static member of outer type 'A.Test' via nested type 'B.Test.TestClass'
I dont like the solution of setting: static int abc = 0;
Is there any other solution for this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…