I have an interface:
public interface InterfaceA {
public ArrayList<? extends Object> b();
public Object b(String string);
public void c(Object object);
}
The first two methods work fine when I implement them:
public class ClassA implements InterfaceA {
public ArrayList<SomeObject> b() {
...
}
public SomeObject b(String string) {
...
}
}
But I can't implement the third one like this:
public void c(SomeObject object) {
...
}
Is there any way of declare a method with a "generic" parameter to implement it with different objects?
public ArrayList<?> b();will be enough. All Java classes are descendants ofObject.