C# Type MakeArrayType()
Description
Type MakeArrayType()
returns a Type object representing
a one-dimensional array of the current type, with a lower bound of zero.
Syntax
Type.MakeArrayType()
has the following syntax.
public virtual Type MakeArrayType()
Returns
Type.MakeArrayType()
method returns A Type object representing a one-dimensional array of the current type,
with a lower bound of zero.
Example
The following code example creates array, ref (ByRef in Visual Basic), and pointer types for the Test class.
//from ww w .j av a 2s . c o m
using System;
using System.Reflection;
public class Example
{
public static void Main()
{
Type t = typeof(Example).MakeArrayType();
t = typeof(Example).MakeArrayType(2);
Console.WriteLine(t);
}
}
The code above generates the following result.