Check out example codes for "class list contains class java". It will help you in understanding the concepts better.

Code Example 1

List<Card> hand = ...;
for(Card card : hand){
  if (card instanceof AceOfDiamonds) return true;
}

Learn ReactJs, React Native from akashmittal.com