+ 2
How to Access Protected Method and/or Class from Other Class in C#
Just for example, let's say I have something like this protected class A{ protected void x() { //some code } } Then how to call the void x() outside from the class A? I've tried to do something like this sealed class B : A{ static void Main(){ A n = new A(); n.x(); } } But it's not working. Please help me with this
1 ответ
+ 2
in non-static method in class B you can access x() like that: this.x().