Possible Duplicate:
Why Would I Ever Need to Use C# Nested Classes
I'm doing it shorty, I have a class which looks like this:
namespace Blub { public class ClassTest { public void teest() { return "test"; } public class AnotherTest { public void blub() { return "test"; } } } } I can access to the function called "teest" like this, but how can I access to the function "blub" without doing another "new ClassTest.AnotherTest()"?
Accessing to the function teest:
Blub.ClassTest = new Blub.ClassTest(); ClassTest.teest(); //test will be returned My try (and how I want it to, to access on AnotherTest is this:
Blub.ClassTest = new Blub.ClassTest(); ClassTest.blub(); //test will be returned Which don't work, I can just access to AnotherTest like this, how I dont want it:
Blub.ClassTest2 = new Blub.ClassTest.AnotherTest(); ClassTest.blub(); //test will be returned Does someone know a solutions for this?