Search code examples
javatype-conversionmethod-invocation

Java method invocation conversion


Hello I reading about java types conversion, so I found in the book Java Language Specification made by Oracle this quote :

Method invocation conversion is applied to each argument in a method or constructor invocation and, except in one case, performs the same conversions that assignment conversion does.

So can someone tells me what's the excepted case ?


Solution

  • From chapter 5 of the JLS:

    Method invocation conversions specifically do not include the implicit narrowing of integer constants which is part of assignment conversion (§5.2). The designers of the Java programming language felt that including these implicit narrowing conversions would add additional complexity to the overloaded method matching resolution process (§15.12.2).