SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
When I run the following code using command line its gives me error?
One Question here .when there is type erasure , the two methods should work right?
why should it show compiler error?
Jyothsna Panchagnula wrote:Hi Henry,
Can you give me more details . I am not getting it
When type erasure happens , then it should work right?
please confirm my understanding.
Jyothsna Panchagnula wrote:
As the method in the child class "overloads" the method , the mehtod should compile rite.
Here is where I am banging my head. I am not able to understand , if the method is overloaded,
then why doesnt it compile?
Now, with erasure, both methods become a single parameter of List. This means that it is not possible of the Child to overload the method, it is overriding the method. Overriding the method violates the type check... hence, the compiler will not allow it.
While compilation, Do not consider <TYPE>, for Generics !
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|