What are the nested types in C#?

 Posted by Goud.Kv on 9/3/2014 | Category: C# Interview questions | Views: 403 | Points: 40
Answer:

In some cases, we may have a class (or struct) inside another class.
That inner class (or type such as struct) is known as a Nested class or Nested type.

Example,
class Outer

{
class Inner // Nested class
{
.........;
........;
}
}
Any class declared outside (such as in a namespace or any compilation unit), is known as Non-Nested class or Non-Nested type.


Asked In: Spotted While Learning | Alert Moderator 

Comments or Responses

Login to post response