I don't think you actually need to cast the instances to an Object type when inserting them into the array.
Since Object is a superclass of all of your custom types, no casting is required.
However casting will be required to convert the Object back to its original type.
Since Object is a superclass of all of your custom types, no casting is required.
However casting will be required to convert the Object back to its original type.