I am writing a couple of interfaces for tree data structure. I am getting
Cannot make a static reference to the non-static type E
compilation error.
Here is my interface hierarchy:
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
}
It will be great if someone can explain the cause of this error.