一样的
看看Javadoc原文This method is identical in functionality to the add(Object) method (which is part of the List interface).
只是一个是继承来的

解决方案 »

  1.   

    不一样,add()返回的是boolean,而addElement()没有返回值!
      

  2.   


        public synchronized void addElement(Object obj) {
    modCount++;
    ensureCapacityHelper(elementCount + 1);
    elementData[elementCount++] = obj;
        }
     
    public synchronized boolean add(Object o) {
    modCount++;
    ensureCapacityHelper(elementCount + 1);
    elementData[elementCount++] = o;
            return true;
        }
    你说有什么区别?自己看代码就是了。
      

  3.   

    add()方法主要是为了实现List接口中的方法!