Re: Java keyword "super"

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: James Mcphee
Date:  
To: Main PLUG discussion list
Subject: Re: Java keyword "super"
Check the answer to this stackoverflow. It says it better than I can.
http://stackoverflow.com/questions/3009745/what-does-the-question-mark-in-java-generics-type-parameter-mean

On Sat, May 21, 2016 at 1:08 PM, trent shipley <>
wrote:

> Can anyone tell me what the keyword "super" does in this parameter list
> for the constructor below? I can only find documentation for the more
> mundane use when a method references an ancestor.
>
> public WeightedCollection(Comparator<? super E> comp)
>
>
> package pcgen.base.util;
>
> <</ deleted stuff>>
>
> /**
>
> * Constructs an empty WeightedCollection with the given Comparator used to
>
> * establish equality and order in the WeightedCollection.
>
> *
>
> * @param comp
>
> *            The Comparator this Set will use to determine equality and

>
> *            order of the WeightedCollection

>
> */
>
> public WeightedCollection(Comparator<? super E> comp)
>
> {
>
>      if (comp == null)

>
>      {

>
>           theData = new ListSet<WeightedItem<E>>();

>
>      }

>
>      else

>
>      {

>
>           theData = new TreeSet<WeightedItem<E>>(

>
>                 new WeightedItemComparator<E>(comp));

>
>      }

>
> }
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>




--
James McPhee

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss