Forum Stats

  • 3,750,551 Users
  • 2,250,192 Discussions
  • 7,867,005 Comments

Discussions

How To Override Supertype Generic Method with List Parameter

1027945
1027945 Member Posts: 1
edited Feb 2, 2016 7:54PM in Generics

Does anyone know if the following is possible and if so, how to do it?

public interface Factory {

       public <T extends Object> Response create(T value);

}

public class ListFactory implements Factory {

       public <T extends List<?>> Response create(List<?> value) {...}

}

The compile complains that the method create(List<?>) of type ListFactory must override or implement a supertype method

This discussion has been closed.