Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How To Override Supertype Generic Method with List Parameter

1027945Feb 2 2016

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

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 1 2016
Added on Feb 2 2016
0 comments
959 views