加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

为什么`invokespecial`用于调用java中的“方法?

发布时间:2020-12-15 08:48:19 所属栏目:Java 来源:网络整理
导读:为什么invokespecial用于调用 init java中的方法? 我在多个地方读过但却无法理解完美的理由? 任何帮助,将不胜感激. 解决方法 从 here开始: The main use of invokespecial is to invoke an object’s instance initialization method, init ,during the c
为什么invokespecial用于调用< init> java中的方法?

我在多个地方读过但却无法理解完美的理由?

任何帮助,将不胜感激.

解决方法

从 here开始:

The main use of invokespecial is to invoke an object’s instance initialization method,<init>,during the construction phase for a new object.

也是从here开始:

In other words,invokespecial is used to call methods without concern for dynamic binding,in order to invoke the particular class’ version of a method.

第二个引用最适用于您的问题,因为我们知道调用构造函数(< init>)方法始终具有静态绑定.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读