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

# 15.12.2.2. Phase 1: Identify Matching Arity Methods Applicable by Strict Invocation

An argument expression is considered *pertinent to applicability* for a potentially applicable method `m` unless it has one of the following forms:

- An implicitly typed lambda expression ([§15.27.1](15.27.1.md)).
- An inexact method reference expression ([§15.13.1](15.13.1.md)).
- If `m` is a generic method and the method invocation does not provide explicit type arguments, an explicitly typed lambda expression or an exact method reference expression for which the corresponding target type (as derived from the signature of `m`) is a type parameter of `m`.
- An explicitly typed lambda expression whose body is an expression that is not pertinent to applicability.
- An explicitly typed lambda expression whose body is a block, where at least one result expression is not pertinent to applicability.
- A parenthesized expression ([§15.8.5](15.8.5.md)) whose contained expression is not pertinent to applicability.
- A conditional expression ([§15.25](15.25.md)) whose second or third operand is not pertinent to applicability.

Let `m` be a potentially applicable method ([§15.12.2.1](15.12.2.1.md)) with arity *n* and formal parameter types F_1, ..., F_n, and let `e_1`, ..., `e_n` 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 strict invocation* if both of the following are true:

  - For 1 ≤ *i* ≤ *n*, if `e_i` is pertinent to applicability then `e_i` is compatible in a strict invocation context with F_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 strict invocation* if, for 1 ≤ *i* ≤ *n*, either `e_i` is compatible in a strict invocation context with F_i ([§5.3](5.3.md)) or `e_i` is not pertinent to applicability.

If no method applicable by strict invocation is found, the search for applicable methods continues with phase 2 ([§15.12.2.3](15.12.2.3.md)).

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

The meaning of an implicitly typed lambda expression or an inexact method reference expression is sufficiently vague prior to resolving a target type that arguments containing these expressions are not considered *pertinent to applicability*; they are simply ignored (except for their expected arity) until overload resolution is finished.
