C# allows you to write inner classes too. However, the rules are much simpler than in Java  when it comes to this. Java allows you to write four types of inner classes:
 Java has complex access privileges and scope for inner classes indeed.
static inner classes;
member inner classes (non-static inner classes – also known as nested classes);
local inner classes (a class within a method);
anonymous inner classes  (a class within a method without a name).
 This type of Java inner class is very commonly used in AWT and Swing.
The first two are inner classes declared at class scope, while the others are inner classes declared at method scope. C# only supports the second type of inner classes (nested ...