Sandra : Mr. Stein has explained this well, but as he knows, I like to ruminate on
things a bit, especially since this S&B question stumped me too. My learning point
is that the compiler is all about variable type. It does not take the time to figure out
what object type will be assigned. So 'o1' as a Object can be down-cast to any type,
including an array. The rules for casting arrays is that they must share the same
dimension and be assignment compatible. For example:
This is okay because 'bb' can access all Alpha[] methods, and Object[] methods
too. A tricky part of the S&B question is that the compiler polices the variable
types while assignment compatibility is a run time
test.
Jim ...
...