Handling inheritance with Parent Class and Child Classes with nested objects
<p>Suppose I  have a class Child extending Class Parent. The class Child has two nested classes nested1 and nested2.  I want a abstract function to be defined in Parent with argument as nested1 and return type as nested 2. Right now , to achieve this , I have created a function with both argument and return type as Object. </p>

<p>So now , when I implement the child class , I am always required to cast the Object to nested1 and nested2. I feel there would be a better way to achieve this. Is there any better way to reduce the complexity?</p>

<p>Also attached the UML
<a href="https://i.stack.imgur.com/OG5kp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OG5kp.png" alt="enter image description here"></a></p>