It's not a good design from an object-oriented design perspective.
You should receive it in an abstracted type (or interface) of CircleTwo, not as an CircleTwo.
Objecto means you're going to get all types. Then the reason for the transform is to transform the object into a class where the method exists to invoke the method of the object.
If it was designed properly, it would have been possible to get it into CircleTwo's interface or abstract class and call it without transforming it.
© 2024 OneMinuteCode. All rights reserved.