[chuck-users] Mixed Object Lists and Hierarchy

Kassen signal.automatique at gmail.com
Fri Dec 11 14:34:44 EST 2009


mike;


> Why can't I make an array of a parent type with objects of a single
> type, which is a child of the parent?
>
>
Because you forgot to cast. You can cast anything to a type that it extends
or that extends it (this includes Object). As long as you keep your
inheritance very clean and overload member functions carefully this works
fine and shouldn't damage your sanity.  At least not much. Most of the time.

Yours,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20091211/c021542d/attachment.html>


More information about the chuck-users mailing list