As an example, let's create an array to hold two DataSeries.
Declare the array, and declare two DataSeries.
[FONT="Courier New"]private DataSeries [] sumSeries;[/FONT] [SIZE="2"] //the array named sumSeries that will contain DataSeries objects.[/SIZE] [FONT="Courier New"]private DataSeries ds0,ds1; [/FONT] [SIZE="2"]//the two DataSeries that will be held in the array[/SIZE]
[FONT="Courier New"]ds0=new DataSeries(this); ds1=new DataSeries(this); sumSeries = new DataSeries[2];[/FONT] [SIZE="2"]// array of [I]length[/I] 2 defined, but at this point is empty[/SIZE] [SIZE="3"]([B]length[/B] of array is the [I]number of elements it contains[/I])[/SIZE] [SIZE="2"]//now populate the array[/SIZE] [FONT="Courier New"]sumSeries[0]=ds0; sumSeries[1]=ds1;[/FONT]
Comment