Help regarding class in c#

  • Thread starter Thread starter trialproduct2004
  • Start date Start date
T

trialproduct2004

Hi all
i am having problem in c# class.
I have two classes one nexted inside another.
What i want is to have one command function to be defined in outerlevel
class and to be accessiable in nested class.
Is it possible.
Because my function is public but i am not able to access it in nested
class.
can some one help me.
any help will be appreciated.
thanks in advance.
 
i am having problem in c# class.
I have two classes one nexted inside another.
What i want is to have one command function to be defined in outerlevel
class and to be accessiable in nested class.
Is it possible.
Because my function is public but i am not able to access it in nested
class.
can some one help me.

You do have access to it, but if it's an instance method, you'll need
an instance of the outer class to call it on, just as you would
elsewhere. Unlike Java inner classes, nested classes don't implicitly
have an instance of an outer class associated with them.
 
Back
Top