In the K&B SCJP book I have read that generic types are only for the compilation type. After it, they are removed and they look like old non generic classes. Here I paste 2 codes for which I would like any of you to explain me (please!!!) how it happens that I can actually get the generic type during the run time.
In the first code, we extend the generic class and then through the subclass we are able to get the generic type of the superclass:
The output is:
The second code does the same but without extending:
And the output is:
Can anyone help me with understanding this 2 codes?