public class Deck <T extends Card>
The deck does not expand the Card.
This is a general annotation, and it says that the deck can be of type T, where T is a subclass of Card.
This is the same as the Java collection classes, where List of String also does not extend String (but contains String instances).
This allows you to write code like:
Deck<PokerCard> pokerDeck = new Deck<PokerCard>(); PokerCard c = pokerDeck.getTopCard();
source share