For example (and this is very simplified), suppose I have a class for every card in a deck of cards... e.g. a KingOfSpaces
class, a QueenOfSpades
class, a JackOfDiamonds
class, etc. All of which that extend Card
. There might be multiple instances of KingOfSpaces
.
And I have an ArrayList<Card>
, with 5 objects in it. How can I check to see if that ArrayList
contains at least one AceOfDiamonds
?