The process of changing byte and short to int in jvm

Asked 1 years ago, Updated 1 years ago, 130 views

As far as I know, byte and short are converted to int in Java jvm.vm Then, I wonder why Byte and short were created and when they were used.

java jvm byte

2022-09-21 17:06

1 Answers

It is not just converted, but int converted and stored only in the local variable array or operand stack in the stack frame, and when saving as a heap, it is restored to its original form and stored.

In other words, when calling a method, the parameters of the method must be put in the stack, which seems to facilitate access to a multiple of 4.


2022-09-21 17:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.