astore_n : store object reference in local variable <n> : index :

Description
Pops objectref (a reference to an object or array) off the stack and stores it in local variable <n>, where <n> is 0, 1, 2 or 3. <n> must be a valid local variable number in the current frame.

'astore_n' is functionally equivalent to 'astore <n>', although it is typically more efficient and also takes fewer bytes in the bytecode.
Example
astore_0        ; store reference in local variable 0
astore_1        ; store reference in local variable 1
astore_2        ; store reference in local variable 2
astore_3        ; store reference in local variable 3
Notes
astore can also be used to store a returnAddress in a local variable. See the jsr instruction for more details.
See also
astore istore fstore dstore lstore aload iload fload dload lload
Stack
Before After
objectref ...
... ...
Bytecode
Type Description
u1 astore_0 opcode = 0x4B (75)
u1 astore_1 opcode = 0x4C (76)
u1 astore_2 opcode = 0x4D (77)
u1 astore_3 opcode = 0x4E (78)