title: Why does ArrayList class uses the name elementData as attribute and as method?
body: <p>I'm trying to understand that fact. ArrayList stores data in :</p>
  
  <p><code>private transient Object[] elementData;</code></p>
  
  <p>Now when for instance we add an element to the ArrayList, it uses the following : </p>
  
  <pre><code>public boolean add(E e) {
    ensureCapacityInternal(size + 1);  // Increments modCount!!
    elementData[size++] = e;
    return true;
  }
  </code></pre>
  
  <p>I don't understand the line <code>elementData[size++] = e;</code> . And I saw a method I think this line is related to : </p>
  
  <pre><code>@SuppressWarnings("unchecked")
      E elementData(int index) {
          return (E) elementData[index];
  }
  </code></pre>
  
  <p>I don't understand why <code>elementData</code> is used both as a method name and an attirbute name...</p>