Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the java compiler exit void methods?

Tags:

java

When the compiler reaches the end of a void method does it just call return; ? Can anyone tell me where I can find documentation on such behavior?


1 Answers

Yes, if you look at the byte code javap -c class, you will see the RETURN instruction in void methods.

You can find out more about bytecode by reading the JVM specs.

like image 172
LanguagesNamedAfterCofee Avatar answered Mar 08 '26 22:03

LanguagesNamedAfterCofee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!