Nested Types

Classes can also define Nested Types. Nested types are like regular custom types, except they are considered part of the class and their visibility can be scoped as granular as all class Members.

Nested types aree declared using the nested in syntax, and (outside of the containing class) are referred to in the same way as static class members would – prefixed with the name of the class, and dot.

Refer to the Nested Types topic for more details.

  OuterClass = public class

  InnerClass nested in OuterClass = public class

These can be accessed like OuterClass.InnerClass.


A visibility level modifier can be applied to a class type, the default level is assembly. Note that because nested types are considered class members, they can be applied the full range of more granular member visibility levels, instead od just public or assembly.

Other Modifiers

A nested type can be any Custom Type or Type Alias that is marked with the nested in Type Modifier.

See Also