Java方法调用转换

标签 java type-conversion method-invocation

您好,我正在阅读有关 java 类型转换的内容,因此我在 Oracle 制作的《Java 语言规范》一书中找到了这样的引用:

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.

那么有人可以告诉我什么是异常(exception)情况吗?

最佳答案

来自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).

关于Java方法调用转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30543168/

相关文章:

language-agnostic - 消息传递和方法调用有什么区别?

java - 如何防止 Tomcat6 在 WEB-INF/lib 中预加载 JDBC 驱动程序?

java - 无法对 selenium 中禁用的元素使用发送键

javascript - == 和 != 已经变成不好的做法了吗?

C ascii 到 hex 代码

c++ - 如何修复以下代码中的转换错误?

java - n 数量整数之和扫描器

java - 摆脱这个无限循环的最佳方法是什么?

Java 性能问题

java - 我可以检查是否返回了 void 方法吗?