Anant Agarwalla wrote: . . . In the above piece of code, i have made Sub as a subclass of Super class. . . .
No, you haven’t. It doesn’t say anything about extends Super. Those two classes both extend java.lang.Object directly, so you are using Object’s no‑args constructor as the target of super().
And welcome to the Ranch
I would have added
code tags to your post, which would have made it look so much better, but you hadn’t indented your code.