I have an abstract generic method in a abstract class:
/**
* @param <Value>
*/
public abstract class TestAbstract<Value> {
public abstract <Value> void test(Value value);
}
Now I extend from this class and implement the abstract generic Method - this is my attempt, but this is obviously wrong.
public class Impl extends TestAbstract<Integer> {
@Override
public <Integer> void test(Integer value) {
// value is instanceOf as java.lang.Object and not java.lang.Integer !
}
}
Within test() value is treated as Object and not as Integer...
How can I override this Method, so that I am forced to use the 'integer'-Class?
Thanks!
Valuean actual class in your project?Object", can you be more specific?int, that is not possible with generics.