---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 9 Edition"
java_version: 9
chapter: "Chapter 15. Expressions"
section: "15.12.2.4"
heading: "15.12.2.4. Phase 3: Identify Methods Applicable by Variable Arity Invocation"
parent: "15.12.2. Compile-Time Step 2: Determine Method Signature"
source: https://docs.oracle.com/javase/specs/jls/se9/html/jls-15.html#jls-15.12.2.4
id: "15.12.2.4"
url: https://jvm.obfuscated.software/jls/se9/15.12.2.4.html
raw: https://jvm.obfuscated.software/jls/se9/15.12.2.4.md
---

# 15.12.2.4. Phase 3: Identify Methods Applicable by Variable Arity Invocation

Where a variable arity method has formal parameter types F_1, ..., F_{n-1}, F_n`[]`, let the *i*'th *variable arity parameter type* of the method be defined as follows:

- For *i* ≤ *n*-1, the *i*'th variable arity parameter type is F_i.
- For *i* ≥ *n*, the *i*'th variable arity parameter type is F_n.

Let `m` be a potentially applicable method ([§15.12.2.1](15.12.2.1.md)) with variable arity, let T_1, ..., T_k be the first *k* variable arity parameter types of `m`, and let `e_1`, ..., `e_k` be the actual argument expressions of the method invocation. Then:

- If `m` is a generic method and the method invocation does not provide explicit type arguments, then the applicability of the method is inferred as specified in [§18.5.1](18.5.1.md).

- If `m` is a generic method and the method invocation provides explicit type arguments, then let R_1 ... R_p (*p* ≥ 1) be the type parameters of `m`, let B_l be the declared bound of R_l (1 ≤ *l* ≤ *p*), and let U_1 ... U_p be the explicit type arguments given in the method invocation. Then `m` is *applicable by variable arity invocation* if:

  - For 1 ≤ *i* ≤ *k*, if `e_i` is pertinent to applicability ([§15.12.2.2](15.12.2.2.md)) then `e_i` is compatible in a loose invocation context with T_i`[`R_1:=U_1, ..., R_p:=U_p`]` ([§5.3](5.3.md)).
  - For 1 ≤ *l* ≤ *p*, U_l `<:` B_l`[`R_1:=U_1, ..., R_p:=U_p`]`.

- If `m` is not a generic method, then `m` is *applicable by variable arity invocation* if, for 1 ≤ *i* ≤ *k*, either `e_i` is compatible in a loose invocation context with T_i ([§5.3](5.3.md)) or `e_i` is not pertinent to applicability.

If no method applicable by variable arity invocation is found, then a compile-time error occurs.

Otherwise, the most specific method ([§15.12.2.5](15.12.2.5.md)) is chosen among the methods applicable by variable arity invocation.
