Thursday, October 23, 2008

Array Declarations (Objective 1.3)

Arrays can hold primitives or objects, but the array itself is always an object.
When you declare an array, the brackets can be to the left or right of the variable name.
It is never legal to include the size of an array in the declaration.
An array of objects can hold any object that passes the IS-A (or instanceof) test for the declared type of the array. For example, if Horse extends Animal,
then a Horse object can go into an Animal array.

No comments: