比如说一个接口interface List{
    public boolean empty();
    public void append(Object o);
    public Object getElement(int index);
    public void delet(int index);
}如何写一个泛型的类去继承这个接口??谢谢大家

解决方案 »

  1.   

    有一个要求忘说了,是不能用java类库里的类实现的,比如说不能用arrayList,只能用array。谢谢大家
      

  2.   

    is there any body knows it?
      

  3.   

    仅限于5.0 (JDK1.5)
    package testGenType;public interface TestInterface { public boolean empty();}package testGenType;public class TestClass<T> implements TestInterface
    { /**
     * @param args
     */

    public static void main(String[] args) {
    // TODO 自动生成方法存根
    TestInterface tInterface = new TestClass<String>();
    System.out.println(tInterface.empty());

    }
    public boolean empty(){return true;}}貌似JDK6.0不支持这么写。