is it possible to set multiple object types to the same custom class?
Yes. You're basically just changing the type of class used with new
.
Note that inside a constructor, the object has not yet actually finished initialisation. It is only in its final state once it has run all super calls, initialised the entire inheritence chain, and then finished the most-derived class constructor. So if you want to inspect the fully initialised state of the instance, you need to check that after creation.