fconst_f : push the single float 0.0, 1.0 or 2.0 : index :

Description
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 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.
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 stack
See also
bipush sipush ldc ldc_w ldc2_w aconst_null iconst_m1 lconst_l iconst_n lconst_l dconst_d
Stack
Before After
... <f>
...
Bytecode
Type Description
u1 fconst_0 opcode = 0x0B (11)
u1 fconst_1 opcode = 0x0C (12)
u1 fconst_2 opcode = 0x0D (13)