title: Java - ArrayList default initial values
body: <p>When you create an arraylist of type Integer in Java what are the default values? I need to check if an arraylist is full and I was going to get the size of the array then get the value at the last index and check if it was the default value.</p>
  
  <p>Is there a better way? What would be the default value?</p>
  
  <p>Hope that makes sense. Cheers</p>
  
  <pre><code>int size = a.size();
  int last = a.get(size);
  if( last == null )
  {
      return true;
  }else{
      return false;
  }
  </code></pre>
  
  <p>Edit;</p>
  
  <p>Is it possible to create an ArrayList with a max size that you can not go over to stop it dynamically expanding?
  When you create an ArrayList and you use size() would that return the actual size or the amount of elements in the arraylist?
  When doing this to create a max size would the default values be null?</p>
  
  <pre><code>public boolean isFull()
  {
      int size = a.size();
      int last = 0;
      try{
          last = a.get(size-1);
      }catch (Exception e){
      }
      if( last == null )
      {
          return true;
      }else{
          return false;
      }
  }
  </code></pre>
  
  <p>I currently have this, how does it look? Does this make sense now?</p>