Your program is 100% correct,
- You have initialized all variables and classes
- You have used the inheritance between the classes.
- Methods has been declared and everthing is fine.
- Your program works 100% for sure.
- Why it is not showing any output means,
- You have just initialized the objects for XClass and YClass but
no passing any arguments.
- Moreover, in the whole program you haven't written any print
statement to output something.
- Corrections to be made
- Try to pass the arguments in the form of values to the
objects.
- Include print statements to display the output.
I hope the above information and explanation will help
you out to understand!
Please comment if you have any
queries/errors!
Thank you!