In C#, trying to compile the following code yields an error, "Circular base class dependency involving 'A' and 'A.B'"
public class A : A.B
{
public class B { }
}
However, I am looking at a 3rd party DLL via a decompiler, and seeing this structure. How is this possible? I can only assume the third party DLL was written in some other .Net language, but what language and what was the syntax?
A nested class is a class declared in another enclosing class. It is a member of its enclosing class and the members of an enclosing class have no access to members of a nested class. Let us see an example code snippet of nested classes in C#.
If a class is nested in the public section of a class, it is visible outside the surrounding class. If it is nested in the protected section it is visible in derived classes, if it is nested in the private section, it is only visible for the members of the outer class.
A nested class is quite simply a class defined within a class. Technically, wherever you can use a nested class you could use a non-nested class; thus the reason for employing the nested class idiom is a semantic reason.
A nested class can be declared with any access modifier, namely private, public, protected, internal, protected internal, or private protected.
It is because the dll you're trying to decompile is "obfuscated". the obfuscator change all the name of the classes so that decompilers cannot be decompiled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With