当前位置:网站首页>JVM四种调用方法的指令
JVM四种调用方法的指令
2022-06-29 09:16:00 【Hao_JunJie】
一、非虚方法:
(1)如果方法在编译期间就确定了具体的调用版本,这个版本在运行时是不可变的。这样的方法称之为非虚方法。
(2)静态方法,私有方法,final 方法,实例构造器,显式调用的方法 都是非虚方法。
(3)其他方法成为虚方法。
二、jvm提供了以下几条方法调用指令:
(1)普通调用指令:
1.invokestatic:调用静态方法,解析阶段确定唯一方法版本。
2.invokespecial:调用<init> 方法,私有及显式调用父类方法,解析阶段确定唯一方法版本。
3.invokevirtual:调用所有虚方法,隐式final 修饰的方法。
4.invokerinterface:调用接口方法。
(2)动态调用指令:
1.invokedynamic:动态解析出需要调用的方法,然后执行。
三、总结:前四条指令固化在虚拟机内部,方法的调用执行不可人为干预,而invokedynamic指令则支持用户确定方法版本。期中invokestatic指令和invokespecial指令调用的方法称之为非虚方法。其余的(final修饰的除外)称为虚方法。
边栏推荐
猜你喜欢

Making of simple addition calculator based on pyqt5 and QT Designer

Fabrication d'une calculatrice d'addition simple basée sur pyqt5 et Qt Designer

Data governance: data standard management (Part III)

MySQL configuring master-slave databases

UE4 blueprint modify get a copy in array to reference

Data visualization: the four quadrants of data visualization teach you to correctly apply icons

A 2.5D Cancer Segmentation for MRI Images Based on U-Net

Segmentation of Head and Neck Tumours Using Modified U-net

ORA-01950 对表空间无权限

CROSSFORMER: A VERSATILE VISION TRANSFORMER BASED ON CROSS-SCALE ATTENTION
随机推荐
内网穿透工具frp使用入门
2020-09-18 referer认证 url转义
2020-09-17 gateway业务流程 两个任务:referer认证和非商品模板化
Deep Learning-based Automated Delineation of Head and Neck Malignant Lesions from PET Images
C语言实现一种创建易管理易维护线程的方法
语言特性
Idea debugging fails, reporting jdwp no transports initialized, jvmtierror=agent_ ERROR_ TRANSPORT_ LOAD(196)
2020-9-14 广告系统入门
Lc236. nearest common ancestor of binary tree
The 23 most useful elasticsearch search techniques you must know
Closed training (25) basic web security
Student增删gaih
Mysql5.7 installation tutorial in centos7 under Linux
監控數據源連接池使用情况
Data visualization: the significance of data visualization
cenos7下搭建LAMP环境
滑块验证代码
基于keil5自动配置stm32f103标准库的官网freertos移植
Official STM32 chip package download address stm32f10x stm32f40x Download
Please use the learned knowledge to write a program to find out the password hidden in the long string below. The burial point of the password conforms to the following rules: