posted 18 years ago
When taking a mock exam i came across this statement "an array can contain elements of any type but they must all be of the same type".
But if we consider a primitive array
double d[]={'c',3.4f,33,44.4};
it can have any value that can be promoted implicitly to the declared type of the array.
Doesn't this contradict the statement "an array can contain elements of any type but they must all be of the same type"?