C# initialization array
Can anybody explain me, why are there code like this in msdn?
// Create the array to store the CDs.
CD[] cdLibrary = new CD[20];
// Populate the CD library with CD objects.
for (int i=0; i<20; i++)
{ cdLibrary[i] = new CD(); }
I cannot understand why the initialization of objects in an array does not
execute in the operator new. And it need additional actions. What did it
make for?
No comments:
Post a Comment