C# Type EmptyTypes
Description
Type EmptyTypes
represents an empty array of type Type.
This field is read-only.
Syntax
Type.EmptyTypes
has the following syntax.
public static readonly Type[] EmptyTypes
Example
The following code example shows the EmptyTypes field used in one of the GetConstructor methods to get a constructor that takes no parameters.
/* www. ja v a 2 s . c om*/
using System;
using System.Reflection;
class MyAssemblyClass
{
public static void Main()
{
Type objType = typeof(System.Array);
ConstructorInfo cInfo = objType.GetConstructor (BindingFlags.ExactBinding, null,
Type.EmptyTypes, null);
}
}
The code above generates the following result.