java.util 
Class ArrayList
java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
All Implemented Interfaces: 
Cloneable, Collection, List, RandomAccess, Serializable 明明是各类呀

解决方案 »

  1.   

    接口的定义???如果是接口,才把add空出来呀。不过arraylist不是接口。源程序网上有,查查.
      

  2.   

    ArrayList和LinkedList都是类,不是interface,他们都implements List这个接口
      

  3.   

    请大家原谅我犯了一个本质的错误,大家再看看在List里有一个方法Iterator(),返回一个ListIterator.它可是一个接口吧!可它可直接作add()操作。
      

  4.   

    你想看源码??我怕你会失望!//////////////////////////////////
       ListIterator listIterator();    /**
         * Returns a list iterator of the elements in this list (in proper
         * sequence), starting at the specified position in this list.  The
         * specified index indicates the first element that would be returned by
         * an initial call to the <tt>next</tt> method.  An initial call to
         * the <tt>previous</tt> method would return the element with the
         * specified index minus one.
         *
         * @param index index of first element to be returned from the
         *     list iterator (by a call to the <tt>next</tt> method).
         * @return a list iterator of the elements in this list (in proper
         *         sequence), starting at the specified position in this list.
         * @throws IndexOutOfBoundsException if the index is out of range (index
         *         < 0 || index > size()).
         */
    这个就是你说的那个方法。源码,因为是接口,其实没有任何代码!
      

  5.   

    笨蛋,源代码在jdk下面的src.zip里面,也许叫src.jar.
    ArrayList是类。
    iterator返回的实现了ListIterator的一个接口。
    你还是去搞清楚extends,implements,上溯造型to  xiongyi3521(xiongying) 
     瞎扯,他现在基本概念都不懂,看什么设计模式
      

  6.   

    9494,它连ArrayList,LinkedList 是接口都搞不清,看设计模式恐怕太早了楼主,王侯将相“宁有种乎”?难道一定要“龙生龙,凤生凤,Interface的儿子是接口”?
    class AClass implements AnInterace,说明它已经是一个类了(也许仍然是abstract),而不再世interface了,一个接口的继承应当是 
    interface AnInterace extends AnotherInterace, NextInterface{
      。
    }