Using Class Methods
To construct an MWStructArray object with the specified dimensions and
field n ames, use
MWStructArray(int[] dims, java.lang.String[] fieldnames)
To construct an MWStructArray object with the specified number of rows
and columns, and field names, use
MWStructArray(int rows, int cols, java.lang.String[] fieldnames)
Input Parameters
dims
Array of dimension sizes. Each dimens ion size must be nonnegative.
fieldnames
Array of field names
rows
Number of rows in the array. This number must be nonnegative.
cols
Number of columns in the array. This number must be nonnegative.
Example — Constructing a Structure Arr ay Object
This first example creates a 0-by-0 MWStructArray object:
MWStructArray S = new MWStructArray();
System.out.println("Structure array S: " + S);
When run, the example displays this output:
Structure array S: []
4-119
Komentarze do niniejszej Instrukcji