Q
Qu0ll
Further to the recent discussion on this topic, I have the following
situation that generates a warning and I don't completely understand why.
I have classes A and B and another class:
public class C<T extends B> extends A {
....
}
Now, when I try to do this:
C<D> c = (C<D>)a;
where D extends B and "a" is an instance of A, I get this warning:
Type safety: Unchecked cast from A to C<D>
Why? Is there a way to code around this without suppressing warnings? The
code works fine.
--
And loving it,
-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]
situation that generates a warning and I don't completely understand why.
I have classes A and B and another class:
public class C<T extends B> extends A {
....
}
Now, when I try to do this:
C<D> c = (C<D>)a;
where D extends B and "a" is an instance of A, I get this warning:
Type safety: Unchecked cast from A to C<D>
Why? Is there a way to code around this without suppressing warnings? The
code works fine.
--
And loving it,
-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]