I have problem with generics. I'm trying to assign some value to an interface with wildcard <?> and get an error. What would be your advice for refactoring?
The method get( capture#4-of ?) in the type MyInterface is not applicable for the arguments (Object)
class X {
MyInterface<?> mi;
<Z> void init (MyInterface<Z> mi)
this.mi = mi;
}
void doSmth (){
mi.get((Object)1); // hier error
}
}
interface MyInterface <T> {
Object get(T something);
}