<?xml version="1.0"?>
<clause number="17.5.1" title="Method parameters">
  <paragraph>The parameters of a method, if any, are declared by the method's <non_terminal where="17.5.1">formal-parameter-list</non_terminal>. <grammar_production><name><non_terminal where="17.5.1">formal-parameter-list</non_terminal></name> : <rhs><non_terminal where="17.5.1">fixed-parameters</non_terminal></rhs><rhs><non_terminal where="17.5.1">fixed-parameters</non_terminal><terminal>,</terminal><non_terminal where="17.5.1">parameter-array</non_terminal></rhs><rhs><non_terminal where="17.5.1">parameter-array</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.5.1">fixed-parameter</non_terminal>s</name> : <rhs><non_terminal where="17.5.1">fixed-parameter</non_terminal></rhs><rhs><non_terminal where="17.5.1">fixed-parameters</non_terminal><terminal>,</terminal><non_terminal where="17.5.1">fixed-parameter</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.5.1">fixed-parameter</non_terminal></name> : <rhs><non_terminal where="24.2">attributes</non_terminal><opt/><non_terminal where="17.5.1">parameter-modifier</non_terminal><opt/><non_terminal where="11">type</non_terminal><non_terminal where="9.4.2">identifier</non_terminal></rhs></grammar_production><grammar_production><name><non_terminal where="17.5.1">parameter-modifier</non_terminal></name> : <rhs><keyword>ref</keyword></rhs><rhs><keyword>out</keyword></rhs></grammar_production><grammar_production><name><non_terminal where="17.5.1">parameter-array</non_terminal></name> : <rhs><non_terminal where="24.2">attributes</non_terminal><opt/><keyword>params</keyword><non_terminal where="19.1">array-type</non_terminal><non_terminal where="9.4.2">identifier</non_terminal></rhs></grammar_production></paragraph>
  <paragraph>The formal parameter list consists of one or more comma-separated parameters of which only the last may be a <non_terminal where="17.5.1">parameter-array</non_terminal>. </paragraph>
  <paragraph>A <non_terminal where="17.5.1">fixed-parameter</non_terminal> consists of an optional set of attributes (<hyperlink>24</hyperlink>), an optional ref or out modifier, a type, and an identifier. Each <non_terminal where="17.5.1">fixed-parameter</non_terminal> declares a parameter of the given type with the given name. </paragraph>
  <paragraph>A <non_terminal where="17.5.1">parameter-array</non_terminal> consists of an optional set of attributes (<hyperlink>24</hyperlink>), a params modifier, an <non_terminal where="19.1">array-type</non_terminal>, and an identifier. A parameter array declares a single parameter of the given array type with the given name. The <non_terminal where="19.1">array-type</non_terminal> of a parameter array must be a single-dimensional array type (<hyperlink>19.1</hyperlink>). In a method invocation, a parameter array permits either a single argument of the given array type to be specified, or it permits zero or more arguments of the array element type to be specified. Parameter arrays are described further in <hyperlink>17.5.1.4</hyperlink>. </paragraph>
  <paragraph>A method declaration creates a separate declaration space for parameters and local variables. Names are introduced into this declaration space by the formal parameter list of the method and by local variable declarations in the block of the method. All names in the declaration space of a method must be unique. Thus, it is a compile-time error for a parameter or local variable to have the same name as another parameter or local variable. </paragraph>
  <paragraph>A method invocation (<hyperlink>14.5.5.1</hyperlink>) creates a copy, specific to that invocation, of the formal parameters and local variables of the method, and the argument list of the invocation assigns values or variable references to the newly created formal parameters. Within the block of a method, formal parameters can be referenced by their identifiers in <non_terminal where="14.5.2">simple-name</non_terminal> expressions (<hyperlink>14.5.2</hyperlink>). </paragraph>
  <paragraph>There are four kinds of formal parameters: <list><list_item> Value parameters, which are declared without any modifiers. </list_item><list_item> Reference parameters, which are declared with the ref modifier. </list_item><list_item> Output parameters, which are declared with the out modifier. </list_item><list_item> Parameter arrays, which are declared with the params modifier. </list_item></list></paragraph>
  <paragraph>
    <note>[Note: As described in <hyperlink>10.6</hyperlink>, the ref and out modifiers are part of a method's signature, but the params modifier is not. end note]</note>
  </paragraph>
</clause>
