Share via


ParamArrayAttribute Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Indicates that a method will allow a variable number of arguments in its invocation. This class cannot be inherited.

Inheritance Hierarchy

System. . :: . .Object
  System. . :: . .Attribute
    System..::..ParamArrayAttribute

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Parameter, Inherited := True, AllowMultiple := False)> _
Public NotInheritable Class ParamArrayAttribute _
    Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
public sealed class ParamArrayAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Parameter, Inherited = true, AllowMultiple = false)]
public ref class ParamArrayAttribute sealed : public Attribute
[<Sealed>]
[<AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)>]
type ParamArrayAttribute =  
    class
        inherit Attribute
    end
public final class ParamArrayAttribute extends Attribute

The ParamArrayAttribute type exposes the following members.

Constructors

  Name Description
Public method ParamArrayAttribute Initializes a new instance of the ParamArrayAttribute class with default properties.

Top

Methods

  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

The ParamArrayAttribute indicates that a method parameter is a parameter array. A parameter array allows the specification of an unknown number of arguments. A parameter array must be the last parameter in a formal parameter list, and it must be a single-dimension array. When the method is called, a parameter array permits arguments to a method to be specified in either of two ways:

  • As a single expression of a type that is implicitly convertible to the parameter array type. The parameter array functions as a value parameter.

  • As zero or more arguments, where each argument is an expression of a type that is implictly convertible to the type of the parameter array element.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System Namespace