Creates a one-dimensional Array of the specified Type and length, with 0-based indexing.
[Visual Basic] Overloads Public Shared Function CreateInstance( _ ByVal elementType As Type, _ ByVal length As Integer _ ) As Array [C#] public static Array CreateInstance( Type elementType, int length ); [C++] public: static Array* CreateInstance( Type* elementType, int length ); [JScript] public static function CreateInstance( elementType : Type, length : int ) : Array;
A new one-dimensional Array of the specified Type and length, with 0-based indexing.
Exception Type | Condition |
---|---|
ArgumentNullException | elementType is a null reference (in Visual Basic Nothing). |
ArgumentException | elementType is not a valid Type. |
ArgumentOutOfRangeException | length is less than 0. |
Reference-type elements are initialized to a null reference (Nothing). Value-type elements are initialized to 0.
Array Class | Array Members | System Namespace | Array.CreateInstance Overload List