title: Find the Size (or Length) of custom datatype
body: <p>I have a similar cases with one of the user that posted <a href="https://stackoverflow.com/questions/20410615/java-arraylist-deck-class">a question</a> before. It is a card game, and we have to create a new data type called <code>card</code> where it contains "rank" and "suit".</p>
  
  <p>How to get the size of arrayList of card when we can't use <code>size()</code> or <code>length</code> since it is not a string?</p>
  
  <p>Update: I can't use <code>size()</code> because when I write it, it will gives warning <code>cannot resolve method 'size()'</code></p>
  
  <pre><code>    `ArrayList&lt;Card&gt; hisCards;
      hisCards = new ArrayList&lt;Card&gt;();`
  
  public static int checkColumn(Card cardArray) {
      int cardSize = cardArray.size();
      if (cardSize == 0) {
         return 1;
     }
     return 0;
  </code></pre>
  
  <p>}</p>
  
  <p>I'm just planning to pass it through a function later. <code>cardArray</code> will be substituted by <code>hishand</code>
  Maybe I'm just doing it wrong?</p>