Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Nested Class Function Call
Hello all there,
I am new to C# programming. I am creating a nested class structure in which i need to call a method of outer class from an inner class. Hew, see the code below to get a better understanding of my problem.
//ignore the underscores(_), they are just for indentation of the code.
//How to call the Method1() of class A and class B here.
So, the problem is both the outer classes have the same method named Method1(). Is it possible to specifically call the Method1() of one of the outer classes (A or B). I want to call one of the method from the inner class C. How could I call the Method1() of class A, and how that of Class B.
Also tell me if I give only the function call Method1() without any class object name, or so, which one of the Method1() will get called.
Thanx in advance
0 · ·