fconst_f : push the single float 0.0, 1.0 or 2.0 : index :
fconst_0 ; push single-precision float 0 onto the stack
Note
that you could also use:
ldc 0.0 ; push the float 0.0 onto the stack
although
this instruction takes more space in the class file and is also less
efficient.fconst_0 ; push the float 0.0 onto the stack fconst_1 ; push the float 1.0 onto the stack fconst_2 ; push the float 2.0 onto the stack
| Before | After |
| ... | <f> |
| ... |
| Type | Description |
| u1 | fconst_0 opcode = 0x0B (11) |
| u1 | fconst_1 opcode = 0x0C (12) |
| u1 | fconst_2 opcode = 0x0D (13) |