I am trying to run a Project in Eclipse as a Java application. The error is in one of its class.
public static List<Graph<Integer, String>> graphList = new ArrayList<>(); // Java 7 syntax
public static Graph<Integer, String>[] graph = new Graph[100];
// populate 'graph'
public static Graph<Integer, String> g=new SparseMultigraph<Integer,String>();
and the error is this : Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems: The type Graph is not generic; it cannot be parameterized with arguments
I tried everything from configuring path to updating JRE system library. I am using java.util.List too. Can anyone please throw some light on how to solve this problem . Thanks
The Graph interface needs Vertex and Edge types specified < V,E >.
Change the above code to something like this:
Refer link below for an example: http://www.grotto-networking.com/JUNG/BasicGraphCreation.java
If you still experience a problem, refer thread below: The type Collection is not generic; it cannot be parameterized with arguments <? extends E>