Contents | Prev | Next | Index

newarray

Operation
Create new array

newarray
atype

Forms
newarray = 188 (0xbc)

Stack
..., count ..., arrayref

Description
The count must be of type int. It is popped off the operand stack. The count represents the number of elements in the array to be created.

The atype is a code that indicates the type of array to create. It must take one of the following values:

Array Type

atype

T_BOOLEAN

4

T_CHAR

5

T_FLOAT

6

T_DOUBLE

7

T_BYTE

8

T_SHORT

9

T_INT

10

T_LONG

11

A new array whose components are of type atype, of length count, is allocated from the garbage-collected heap. A reference arrayref to this new array object is pushed into the operand stack. All of the elements of the new array are initialized to the default initial values for its type (§2.5.1).


Contents | Prev | Next | Index

Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com