0
我正在为树形数据结构编写几个接口。我得到 Cannot make a static reference to the non-static type E
编译错误。无法对静态类型进行静态引用E
这里是我的接口层次:
package com.mohit.dsa.global.position;
/**
* @author mohitkum
*/
public interface Position<E> {
public E getElement() throws IllegalStateException;
}
-
package com.mohit.dsa.tree;
import com.mohit.dsa.global.position.Position;
public interface Tree<E> extends Iterable<E> {
Position<E> root;//compilation error for E
}
这将是巨大的,如果有人能解释这个错误的原因。