比如说一个接口interface List{
public boolean empty();
public void append(Object o);
public Object getElement(int index);
public void delet(int index);
}如何写一个泛型的类去继承这个接口??谢谢大家
public boolean empty();
public void append(Object o);
public Object getElement(int index);
public void delet(int index);
}如何写一个泛型的类去继承这个接口??谢谢大家
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不支持这么写。