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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version