You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
周老师您好:
您在书中第8章说:"invokespecial用于调用实例构造器()方法,私有方法和父类中的方法,这些方法为非虚方法",那么我在jls18 8.4.3.3final Methods 这一节注意到这一段描述:
A private method and all methods declared immediately within a final class (§8.1.1.2) behave as if they are final, since it is impossible to override them.
此外,我在private方法调用时,也会出现invokevirtual指令,请问私有方法是不是也是使用invokevirtual指令调用?
我的jdk版本:openjdk-17.jdk
The text was updated successfully, but these errors were encountered:
antaow
changed the title
关于invokespecial与invokevirtual指令问题
p302关于invokespecial与invokevirtual指令问题
Jul 26, 2022
周老师您好:
您在书中第8章说:"invokespecial用于调用实例构造器()方法,私有方法和父类中的方法,这些方法为非虚方法",那么我在jls18 8.4.3.3final Methods 这一节注意到这一段描述:
A private method and all methods declared immediately within a final class (§8.1.1.2) behave as if they are final, since it is impossible to override them.
此外,我在private方法调用时,也会出现invokevirtual指令,请问私有方法是不是也是使用invokevirtual指令调用?
我的jdk版本:openjdk-17.jdk
The text was updated successfully, but these errors were encountered: