As far as I understand.
As you can from the remaining byte code instruction, it does not save the int as byte or short . Firstly, bipush or short : bipush has 2 bytes for the operation code and the second for value. that is, it can be in the range from -128 tp 127 (i.e., from a power of 8) This saves space and execution time. As you can see from recompiling the code compiler, a link is created for this variable as an integer type
2: invokestatic
and then astore_1 , which store what on top of the stack ie a reference here into local variable 1 Similarly for sipush , where you can save a value from the range (-32768 to 32767) beacuse a 3-byte instruction set, one byte for the operation code and the remaining two bytes for the value (i.e. can hold 2 powers of 16)
Now why not the lDC JVM has a constant pool for each type. A bytecode requires data, but most of the time this data is too large to be stored directly in bytecodes. therefore, it is stored in a constant pool, and the bytecode contains a link to the constant pool. That lDC pushes the #index constant from the constant pool (String, int or float) onto the stack. That consumes extra time and loops. The following is an approximate comparison of the lDC operation and the bipush operation


Jvm bytecode ref here he says
If possible, it is more efficient to use one of bipush, sipush, or one of the const commands instead of ldc.
source share