Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p302关于invokespecial与invokevirtual指令问题 #182

Open
antaow opened this issue Jul 26, 2022 · 0 comments
Open

p302关于invokespecial与invokevirtual指令问题 #182

antaow opened this issue Jul 26, 2022 · 0 comments

Comments

@antaow
Copy link

antaow commented 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指令调用?
CleanShot 2022-07-26 at 17 21 13@2x
CleanShot 2022-07-26 at 17 21 34@2x

我的jdk版本:openjdk-17.jdk

@antaow antaow changed the title 关于invokespecial与invokevirtual指令问题 p302关于invokespecial与invokevirtual指令问题 Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant