Java Reference
In-Depth Information
It is a compile-time error if a formal parameter that is declared final is assigned to within
the body of the method or constructor.
It is a compile-time error to use mixed array notation (§ 10.2 ) for a variable arity parameter.
The declared type of a formal parameter is denoted by the Type that appears in its parameter
specifier, followed by any bracket pairs that follow the Identifier in the declarator, except
for a variable arity parameter, whose declared type is an array type whose component type
is the Type that appears in its parameter specifier.
If the declared type of a variable arity parameter has a non-reifiable element type (§ 4.7 ) ,
then a compile-time unchecked warning occurs for the declaration of the variable arity
method, unless the method is annotated with the SafeVarargs annotation (§ 9.6.3.7 ) or the un-
checked warning is suppressed by the SuppressWarnings annotation (§ 9.6.3.5 ).
When the method or constructor is invoked (§ 15.12 ) , the values of the actual argument
expressions initialize newly created parameter variables, each of the declared type, before
execution of the body of the method or constructor. The Identifier that appears in the De-
claratorId may be used as a simple name in the body of the method or constructor to refer
to the formal parameter.
Invocations of a variable arity method may contain more actual argument expressions than
formal parameters. All the actual argument expressions that do not correspond to the form-
al parameters preceding the variable arity parameter will be evaluated and the results stored
into an array that will be passed to the method invocation (§ 15.12.4.2 ) .
A method or constructor parameter of type float always contains an element of the float
value set (§ 4.2.3 ) ; similarly, a method or constructor parameter of type double always con-
tains an element of the double value set. It is not permitted for a method or constructor
parameter of type float to contain an element of the float-extended-exponent value set that
is not also an element of the float value set, nor for a method parameter of type double to
contain an element of the double-extended-exponent value set that is not also an element
of the double value set.
Where an actual argument expression corresponding to a parameter variable is not FP-strict
15.4 ) , evaluation of that actual argument expression is permitted to use intermediate val-
ues drawn from the appropriate extended-exponent value sets. Prior to being stored in the
parameter variable, the result of such an expression is mapped to the nearest value in the
corresponding standard value set by method invocation conversion (§ 5.3 ) .
Search WWH ::




Custom Search