Generics name clash
-
12-11-2019 - |
Frage
Consider:
public interface Foo<T> {
public static class X{}
public void foobar(T t);
}
public class Bar<X> {
Foo<X> foo = new Foo<X>() {
public void foobar(X t) {}
};
}
I found no way to express that I mean the X
from Bar<X>
and not Foo.X
in the foobar(X t)
implementation. Is there no other way than renaming the generic parameter X
in Bar
or the static inner class?
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow