fconst_0 or fconst_1 or fconst_2Stack
Before | After |
... | <f> |
| ... |
fconst_<f> represents the series of opcodes fconst_0, fconst_1, and fconst_2 that are used to push the constant single-precision floats 0.0, 1.0 and 2.0 onto the stack.
For example, to push the single-precision float zero onto the stack, use:
fconst_0 ; push single-precision float 0 onto the stackNote that you could also use:
ldc 0.0 ; push the float 0.0 onto the stackalthough this instruction takes more space in the class file and is also less efficient.
Example
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 stackBytecode
Type | Description |
u1 | fconst_0 opcode = 0x0B (11) |
u1 | fconst_1 opcode = 0x0C (12) |
u1 | fconst_2 opcode = 0x0D (13) |
bipush, sipush, ldc, ldc_w, ldc2_w, aconst_null, iconst_m1, lconst_<l> iconst_<n>, lconst_<l>, dconst_<d>