Consider string.Format()
whose parameters are a string and, among others in the overload list, an object[]
or many objects.
This statement
I think the concept you are having an issue with is why int[]
isn't cast to object[]
. Here's an example that shows why that would be bad
int[] myInts = new int[]{8,9};
object[] myObjs = (object[])myInts;
myObjs[0] = new object();
The problem is that we just added an object into a int array.
So what happens in your code is that myInts
is cast to object
and you don't have a second argument to fill in the {1}