I know that its not a good practice to nest a class inside another class, but following is just for fun.
I have the following code
namespace PlayIt
{
class Class1
{
class Class2 : Class1
{
}
}
class SomeOtherClass
{
Class1 objClass1 = new Class1();
Class2 objClass2 = new Class2();
}
}
I am able to create the object of class1 but not of class2, Why So? Is there any way to access the class2 outside the class1