This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
cat c=new cat; // this won't work, you have to specify size of the instantiated array, e.g. new cat;
my=my; //can't assign a 1-D array to a 2-D array.
my=my; //can't assign a nonarray object to a 2-D array reference.
my=my; //can't assign a nonarray object to a 1-D array reference.
my=c; //can't assign an array object to a nonarray reference my can only refer to a cat object[/QB]
What specifically you don't understand? There is one simple rule here: n-dimensional array reference of object x can only refer to instance of exactly n-dimensional array of object x (or subclass of x, since arrays are polymorphic) - period. In your case, cat instance cannot be assigned to cat reference and vice versa, and so on...