What's the Meaning of the Question Mark Inside the Angle Brackets:
In App Engine, According to the Javadoc, the getTypeRank Method Has This Signature: Public Static Int getTypeRank(java. Lang. Class
In App Engine, according to the JavaDoc, the getTypeRank method has this signature:
public static int getTypeRank(java.lang.Class<? extends java.lang.Comparable> datastoreType)
In the method signature there is a question mark inside the angle brackets:
<? extends java.lang.Comparable>
What does it signify?
4 Answers
? essentially indicates a wildcard. <? extends java.lang.Comparable> means "any type that extends java.lang.Comparable (or Comparable itself) can be used here".
It's called bounded wildcard
<? extends Comparable> is an example of a bounded wildcard. The ? stands for an unknown type, just like the wildcards we saw earlier. However, in this case, we know that this unknown type is in fact a subtype of Comparable. (Note: It could be Comparableitself, or some subclass; it need not literally extend Comparable.)
More details you find here
It means "any class that implements the Comparable interface. Thus, a call would e.g. look like getTypeRank(String.class).
? refers to any subclass of java.lang.Comparable. In other words, any class that extends java.lang.Comparable.