How to resize an array?

I am trying to resize an array, but I am getting these error messages:

incompatible types

found: Shape2[]

required: java.lang.String[]

String [] original = array;

incompatible types

found: java.lang.String

required: Shape2

array = original;

What do they mean?

Here's my code:

publicstatic Shape2 [] resize(Shape2 [] array,int newSize)

{

String [] original = array;

int numToCopy = Math.min(original.length, newSize);

array =new Shape2[newSize];

for(int i = 0; i < numToCopy; i++)

{

array[i] = original[i];

}

return array;

}

[1045 byte] By [JWest46088a] at [2007-10-3 8:56:23]
# 1
> What do they mean?It means that the compiler found a String[] instead of the required Shape2[].
prometheuzza at 2007-7-15 4:06:39 > top of Java-index,Java Essentials,New To Java...