Vector向量中的两个方法:
public Object elementAt(int index)
public Object get(int index)
有什么区别吗~?!

解决方案 »

  1.   

    public synchronized Object elementAt(int index) {
    if (index >= elementCount) {
        throw new ArrayIndexOutOfBoundsException(index + " >= " + elementCount);
    }        return elementData[index];
        }    public synchronized Object get(int index) {
    if (index >= elementCount)
        throw new ArrayIndexOutOfBoundsException(index); return elementData[index];
        }
    看到没有?几乎完全一样的。
      

  2.   

    搞不清的话自己看看 JDK 里的源代码。
      

  3.   

    不同接口的要求呀jdk源码看看就知道了