|Sep10-12, 07:20 AM||#1|
The general form for creating an array is:
But I don't understand wht should I type in the name of the array twice? Because I thought Myarray and arrayname is the same.
|Sep10-12, 07:51 AM||#2|
DO you really mean something like this:
MyArray myArray = new MyArray();
where MyArray is a class and myArray is an instance?
The statement above creates an instance called myArray of type MyArray. This is how you initialize myArray rather like assigning a value to it.
you can't use myArray1, myArray2, or myArray3 until you've assigned them a value that is until you do this:
myArray1 = new MyArray();
myArray2 = new MyArray();
myArray3 = new MyArray();
hope this helps.