Top "Bounded-wildcard" questions

Bounded wildcard is a type argument of the form "? extends T" or "? super T". Bounded wildcards are a feature of generics in the Java language.

Java Generics Wildcarding With Multiple Classes

I want to have a Class object, but I want to force whatever class it represents to extend class A …

java class generics bounded-wildcard
What is PECS (Producer Extends Consumer Super)?

I came across PECS (short for Producer extends and Consumer super) while reading up on generics. Can someone explain to …

java generics super bounded-wildcard pecs
Mockito: Stubbing Methods That Return Type With Bounded Wild-Cards

Consider this code: public class DummyClass { public List<? extends Number> dummyMethod() { return new ArrayList<Integer>(); } } public …

java unit-testing generics mockito bounded-wildcard
Java Generics (Wildcards)

I have a couple of questions about generic wildcards in Java: What is the difference between List<? extends T&…

java generics bounded-wildcard
List<? extends MyType>

I have a Java question about generics. I declared a generic list: List<? extends MyType> listOfMyType; Then in …

java list generics bounded-wildcard
What does List<?> mean in java generics?

What does List<?> mean, does it mean simply a list of objects of unspecified type? Googling for the …

java generics bounded-wildcard
Java: bounded wildcards or bounded type parameter?

Recently, I read this article: http://download.oracle.com/javase/tutorial/extra/generics/wildcards.html My question is, instead of …

java api generics bounded-wildcard
Java nested generic type

How come one must use the generic type Map<?, ? extends List<?>> instead of a simpler Map&…

java generics bounded-wildcard unbounded-wildcard
Java Generics: Multiple Inheritance in Bounded Type Parameters <T extends A & I>

I am about to create a factory which creates objects of a certain type T which extends a certain class …

java generics types bounded-wildcard
Why can't you have multiple interfaces in a bounded wildcard generic?

I know there's all sorts of counter-intuitive properties of Java's generic types. Here's one in particular that I don't understand, …

java generics language-design bounded-wildcard