what does this exactly mean?
public class Deck<T extends Card>
What does the T extends Card mean? Does this imply something about the class Card?
thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It constrains the type parameter (“T”) to be
Cardor a subtype ofCard.So if
… then it is a valid type for use with
Deck(i.e.Deck<FancyCard>). However,Stringobviously does not extendCard, soDeck<String>will not compile.