Sorry I’m kinda new to c# how would I make a class where I can access it like this:
Myclass.subclass.method();
This is what I have now:
namespace zzcore
{
class myclass
{
class subclass
{
public static void method() { }
}
}
}
What happens here is that a nested class without a visibility modifier is implicitly
private. In this context,privatemeans that only the parent class can see it.Declare both classes as
publicand you will be able to callmyclass.subclass.method();Working example: http://ideone.com/tJVKJ